babel/lib/6to5/transformation/transformers/spec/illegal-top-level-this.js
2015-01-22 07:44:36 +11:00

9 lines
284 B
JavaScript

exports.FunctionDeclaration =
exports.FunctionExpression = function (node, parent, scope, context) {
context.skip();
};
exports.ThisExpression = function (node, parent, scope, context, file) {
throw file.errorWithNode(node, "Top level `this` is not allowed", ReferenceError);
};