google-code-export / v8cgi

Automatically exported from code.google.com/p/v8cgi
BSD 3-Clause "New" or "Revised" License
2 stars 1 forks source link

TypeError #81

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

abc = {};

(function() { typeof this["abc"] })();

What is the expected output? What do you see instead?
not an error but i see:

TypeError: Object #<an Object> has no method 'abc' ...
TypeError: Object #<an Object> has no method 'abc' at Object.<anonymous>...

What version of the product are you using? On what operating system?
v8cgi 0.9 precompiled for windows on my windows xp it

Please provide any additional information below.

Original issue reported on code.google.com by nanoyo...@yahoo.it on 4 Jan 2011 at 8:05

GoogleCodeExporter commented 9 years ago
The described behavior is correct. Variables created without the "var" keyword 
are created in global scope (which is, by the way, a very bad practice), but 
the "this" keyword referes to module's exports object.

Original comment by ondrej.zara on 4 Jan 2011 at 9:13