Mercurial > repos > tabletprog
diff compiler.js @ 59:0fd06e077afe
Fix object parent
author | Mike Pavone <pavone@retrodev.com> |
---|---|
date | Sat, 14 Jul 2012 01:39:43 -0700 |
parents | 08ae75d90dc2 |
children | ef3b34c2c0a4 |
line wrap: on
line diff
--- a/compiler.js Sat Jul 14 00:35:50 2012 -0700 +++ b/compiler.js Sat Jul 14 01:39:43 2012 -0700 @@ -67,6 +67,7 @@ this.names = {}; this.needsenv = false; this.typename = null; + this.needsparent = false; } osymbols.prototype.find = function(name, nestedcall) { debugprint('//osymbols.find', name + ', exists?:', name in this.names, ', nested?:', nestedcall); @@ -88,7 +89,9 @@ if(ret.type == 'self') { ret.type = 'parent'; ret.depth = 1; + this.needsparent = true; } else if(ret.type == 'parent') { + this.needsparent = true; ret.depth++; } else if(ret.type == 'closedover' || ret.type == 'upvar') { this.needsenv = true;