diff --git a/lib/nodes.js b/lib/nodes.js index 33317682..91a6ee45 100644 --- a/lib/nodes.js +++ b/lib/nodes.js @@ -895,7 +895,7 @@ // equivalent syntax tree and compile that, in pieces. You can see the // constructor, property assignments, and inheritance getting built out below. ClassNode.prototype.compileNode = function(o) { - var _b, _c, _d, _e, access, applied, className, constScope, construct, extension, func, me, pname, prop, props, pvar, returns, val; + var _b, _c, _d, _e, access, applied, className, constScope, construct, constructor, extension, func, me, pname, prop, props, pvar, returns, val; extension = this.parent && new ExtendsNode(this.variable, this.parent); props = new Expressions(); o.top = true; diff --git a/lib/scope.js b/lib/scope.js index 9e03b5fa..d5fe6265 100644 --- a/lib/scope.js +++ b/lib/scope.js @@ -62,7 +62,7 @@ }; // Just check to see if a variable has already been declared, without reserving. Scope.prototype.check = function(name) { - if (this.variables[name]) { + if (this.variables.hasOwnProperty(name)) { return true; } return !!(this.parent && this.parent.check(name)); diff --git a/src/scope.coffee b/src/scope.coffee index 5cc10dbf..06645fa0 100644 --- a/src/scope.coffee +++ b/src/scope.coffee @@ -46,7 +46,7 @@ exports.Scope: class Scope # Just check to see if a variable has already been declared, without reserving. check: (name) -> - return true if @variables[name] + return true if @variables.hasOwnProperty name !!(@parent and @parent.check(name)) # If we need to store an intermediate result, find an available name for a