Let invalids eval. Works on #124.

This commit is contained in:
Tom MacWright 2011-12-07 23:06:20 -05:00
parent 90fbe75213
commit fe0cc34f8f

View File

@ -5,4 +5,16 @@ tree.Invalid = function Invalid(chunk, index, message) {
this.type = 'syntax';
this.message = message || "Invalid code: " + this.chunk;
};
tree.Invalid.prototype.eval = function(env) {
env.error({
chunk: this.chunk,
index: this.index,
type: 'syntax',
message: this.message || "Invalid code: " + this.chunk
});
return {
is: 'undefined'
};
};
})(require('../tree'));