# HG changeset patch # User Mike Pavone # Date 1377677114 25200 # Node ID d2e0664ba73ecdfaff119f481a1bf51cc5fdb8bb # Parent 49bca64871783813a476388fc1b142e011738237 Don't allow assignments to module variables diff -r 49bca6487178 -r d2e0664ba73e compiler.js --- a/compiler.js Tue Aug 27 23:02:19 2013 -0700 +++ b/compiler.js Wed Aug 28 01:05:14 2013 -0700 @@ -456,7 +456,7 @@ assignment.prototype.populateSymbols = function(symbols) { debugprint('//assignment', this.symbol.name, 'populateSymbols'); var existing = symbols.find(this.symbol.name); - if (!existing) { + if (!existing || existing.type == 'toplevel') { symbols.defineVar(this.symbol.name, this.expression); } this.symbol.populateSymbols(symbols);