changeset 201:d2e0664ba73e

Don't allow assignments to module variables
author Mike Pavone <pavone@retrodev.com>
date Wed, 28 Aug 2013 01:05:14 -0700
parents 49bca6487178
children cea671c4056c
files compiler.js
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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);