Mercurial > repos > tabletprog
comparison compiler.js @ 77:8a9b96888b7d
Fix another symbol table/closure bug
author | Mike Pavone <pavone@retrodev.com> |
---|---|
date | Sun, 15 Jul 2012 13:13:06 -0700 |
parents | 3a169ebb3224 |
children | 9811040704ac |
comparison
equal
deleted
inserted
replaced
76:c801dccdb4fb | 77:8a9b96888b7d |
---|---|
318 throw new Error("Unexpected AST type for foreign:"); | 318 throw new Error("Unexpected AST type for foreign:"); |
319 } | 319 } |
320 } | 320 } |
321 this.symbols = symbols; | 321 this.symbols = symbols; |
322 var name = this.name[this.name.length-1] == ':' ? this.name.substr(0, this.name.length-1) : this.name; | 322 var name = this.name[this.name.length-1] == ':' ? this.name.substr(0, this.name.length-1) : this.name; |
323 symbols.find(name) | 323 var funinfo = symbols.find(name); |
324 if (funinfo && (funinfo.type == 'self' || funinfo.type == 'parent')) { | |
325 symbols.find('self'); | |
326 } | |
324 for (var i in this.args) { | 327 for (var i in this.args) { |
325 this.args[i].populateSymbols(symbols); | 328 this.args[i].populateSymbols(symbols); |
326 } | 329 } |
327 if (this.receiver) { | 330 if (this.receiver) { |
328 this.receiver.populateSymbols(symbols); | 331 this.receiver.populateSymbols(symbols); |