Fix bad parsing of new new x()() constructs

Fixes #739
This commit is contained in:
Richard van Velzen
2015-08-06 21:27:46 +02:00
committed by Mihai Bazon
parent e3bd223dac
commit fcde6109b0
2 changed files with 15 additions and 3 deletions

View File

@@ -1114,7 +1114,7 @@ function parse($TEXT, options) {
});
};
var new_ = function() {
var new_ = function(allow_calls) {
var start = S.token;
expect_token("operator", "new");
var newexp = expr_atom(false), args;
@@ -1129,7 +1129,7 @@ function parse($TEXT, options) {
expression : newexp,
args : args,
end : prev()
}), true);
}), allow_calls);
};
function as_atom_node() {
@@ -1173,7 +1173,7 @@ function parse($TEXT, options) {
var expr_atom = function(allow_calls) {
if (is("operator", "new")) {
return new_();
return new_(allow_calls);
}
var start = S.token;
if (is("punc")) {