| Index: src/parser.cc
|
| diff --git a/src/parser.cc b/src/parser.cc
|
| index 904636bf473c1c36003dfb883ec183312408df89..bb87dd445752a0247a781268f5e9f30ea04dcc72 100644
|
| --- a/src/parser.cc
|
| +++ b/src/parser.cc
|
| @@ -1623,7 +1623,11 @@ Block* Parser::ParseVariableDeclarations(bool accept_IN,
|
| position = scanner().location().beg_pos;
|
| value = ParseAssignmentExpression(accept_IN, CHECK_OK);
|
| // Don't infer if it is "a = function(){...}();"-like expression.
|
| - if (fni_ != NULL && value->AsCall() == NULL) fni_->Infer();
|
| + if (fni_ != NULL &&
|
| + value->AsCall() == NULL &&
|
| + value->AsCallNew() == NULL) {
|
| + fni_->Infer();
|
| + }
|
| }
|
|
|
| // Make sure that 'const c' actually initializes 'c' to undefined
|
| @@ -2376,7 +2380,7 @@ Expression* Parser::ParseAssignmentExpression(bool accept_IN, bool* ok) {
|
| if ((op == Token::INIT_VAR
|
| || op == Token::INIT_CONST
|
| || op == Token::ASSIGN)
|
| - && (right->AsCall() == NULL)) {
|
| + && (right->AsCall() == NULL && right->AsCallNew() == NULL)) {
|
| fni_->Infer();
|
| }
|
| fni_->Leave();
|
| @@ -2775,6 +2779,13 @@ Expression* Parser::ParseMemberWithNewPrefixesExpression(PositionStack* stack,
|
| int pos = scanner().location().beg_pos;
|
| Expression* index = ParseExpression(true, CHECK_OK);
|
| result = new(zone()) Property(result, index, pos);
|
| + if (fni_ != NULL) {
|
| + if (index->IsPropertyName()) {
|
| + fni_->PushLiteralName(index->AsLiteral()->AsPropertyName());
|
| + } else {
|
| + fni_->PushLiteralName(fni_->anonymous_function());
|
| + }
|
| + }
|
| Expect(Token::RBRACK, CHECK_OK);
|
| break;
|
| }
|
|
|