Throw error if new.target is like new.foo

This commit is contained in:
Anthony Van de Gejuchte
2016-06-25 19:32:09 +02:00
parent 6eaeb19a4a
commit 07785d0003
2 changed files with 8 additions and 1 deletions

View File

@@ -85,4 +85,11 @@ describe("New", function() {
);
}
});
it("Should check target in new.target", function() {
assert.throws(function() {uglify.parse("new.blah")}, function(e) {
return e instanceof uglify.JS_Parse_Error
&& e.message === "SyntaxError: Unexpected token name «blah», expected name «target»";
});
});
});