Export to GitHub

v8cgi - issue #81

TypeError


Posted on Jan 4, 2011 by Helpful Wombat

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.

Comment #1

Posted on Jan 4, 2011 by Happy Giraffe

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.

Status: Invalid

Labels:
Type-Defect Priority-Medium