[javascript mode] Fix bug in recognizing local variable in nested context