Index: src/rewriter.cc |
diff --git a/src/rewriter.cc b/src/rewriter.cc |
index e0a0226ec8b8dda96a87357776d995f7fbddb6b9..4d1fbd9dd7a973c757145b82ae7a5e0096515880 100644 |
--- a/src/rewriter.cc |
+++ b/src/rewriter.cc |
@@ -283,7 +283,10 @@ void AstOptimizer::VisitAssignment(Assignment* node) { |
case Token::ASSIGN: |
// No type can be infered from the general assignment. |
- scoped_fni.Enter(); |
+ // Don't infer if it is "a = function(){...}();"-like expression. |
+ if (node->value()->AsCall() == NULL) { |
+ scoped_fni.Enter(); |
+ } |
break; |
case Token::ASSIGN_BIT_OR: |
case Token::ASSIGN_BIT_XOR: |