Implement new.target

This commit is contained in:
Fábio Santos
2015-11-21 14:48:23 +00:00
parent e076abdbf2
commit a800356ad0
4 changed files with 23 additions and 0 deletions

View File

@@ -1292,6 +1292,14 @@ function parse($TEXT, options) {
var new_ = function(allow_calls) {
var start = S.token;
expect_token("operator", "new");
if (is("punc", ".")) {
next();
expect_token("name");
return subscripts(new AST_NewTarget({
start : start,
end : prev()
}), allow_calls);
}
var newexp = expr_atom(false), args;
if (is("punc", "(")) {
next();