OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_PARSING_PARSER_BASE_H | 5 #ifndef V8_PARSING_PARSER_BASE_H |
6 #define V8_PARSING_PARSER_BASE_H | 6 #define V8_PARSING_PARSER_BASE_H |
7 | 7 |
8 #include "src/ast/scopes.h" | 8 #include "src/ast/scopes.h" |
9 #include "src/bailout-reason.h" | 9 #include "src/bailout-reason.h" |
10 #include "src/hashmap.h" | 10 #include "src/hashmap.h" |
(...skipping 2108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2119 // name if we're dealing with "a = function(){...}();"-like | 2119 // name if we're dealing with "a = function(){...}();"-like |
2120 // expression. | 2120 // expression. |
2121 if ((op == Token::INIT || op == Token::ASSIGN) && | 2121 if ((op == Token::INIT || op == Token::ASSIGN) && |
2122 (!right->IsCall() && !right->IsCallNew())) { | 2122 (!right->IsCall() && !right->IsCallNew())) { |
2123 fni_->Infer(); | 2123 fni_->Infer(); |
2124 } else { | 2124 } else { |
2125 fni_->RemoveLastFunction(); | 2125 fni_->RemoveLastFunction(); |
2126 } | 2126 } |
2127 } | 2127 } |
2128 | 2128 |
| 2129 if (op == Token::ASSIGN && allow_harmony_function_name()) { |
| 2130 Traits::SetFunctionNameFromIdentifierRef(right, expression); |
| 2131 } |
| 2132 |
2129 ExpressionT result = factory()->NewAssignment(op, expression, right, pos); | 2133 ExpressionT result = factory()->NewAssignment(op, expression, right, pos); |
2130 | 2134 |
2131 if (is_destructuring_assignment) { | 2135 if (is_destructuring_assignment) { |
2132 result = factory()->NewRewritableAssignmentExpression(result); | 2136 result = factory()->NewRewritableAssignmentExpression(result); |
2133 Traits::QueueDestructuringAssignmentForRewriting(result); | 2137 Traits::QueueDestructuringAssignmentForRewriting(result); |
2134 } | 2138 } |
2135 | 2139 |
2136 return result; | 2140 return result; |
2137 } | 2141 } |
2138 | 2142 |
(...skipping 1207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3346 return; | 3350 return; |
3347 } | 3351 } |
3348 has_seen_constructor_ = true; | 3352 has_seen_constructor_ = true; |
3349 return; | 3353 return; |
3350 } | 3354 } |
3351 } | 3355 } |
3352 } // namespace internal | 3356 } // namespace internal |
3353 } // namespace v8 | 3357 } // namespace v8 |
3354 | 3358 |
3355 #endif // V8_PARSING_PARSER_BASE_H | 3359 #endif // V8_PARSING_PARSER_BASE_H |
OLD | NEW |