fixes #1416: don't omit one 'new' when compiling 'new new'

This commit is contained in:
Jann Horn
2011-06-20 18:38:29 +02:00
parent 11f2cd4515
commit f0c22f390d
2 changed files with 2 additions and 2 deletions

View File

@@ -1596,7 +1596,7 @@
return call;
}
if (op === 'new') {
if (first instanceof Call && !first["do"]) {
if (first instanceof Call && !first["do"] && !first.isNew) {
return first.newInstance();
}
if (first instanceof Code && first.bound || first["do"]) {

View File

@@ -1236,7 +1236,7 @@ exports.Op = class Op extends Base
call.do = yes
return call
if op is 'new'
return first.newInstance() if first instanceof Call and not first.do
return first.newInstance() if first instanceof Call and not first.do and not first.isNew
first = new Parens first if first instanceof Code and first.bound or first.do
@operator = CONVERSIONS[op] or op
@first = first