remap top level this to undefined - #562

This commit is contained in:
Sebastian McKenzie
2015-02-02 10:44:17 +11:00
parent 4763b95a0d
commit fb360039ce
13 changed files with 15 additions and 10 deletions

View File

@@ -17,5 +17,5 @@ exports.FunctionExpression = function (node, parent, scope, context) {
};
exports.ThisExpression = function (node, parent, scope, context, file) {
throw file.errorWithNode(node, "Top level `this` is `undefined` in strict mode", ReferenceError);
return t.identifier("undefined");
};