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/ast.h" | 8 #include "src/ast/ast.h" |
9 #include "src/ast/scopes.h" | 9 #include "src/ast/scopes.h" |
10 #include "src/bailout-reason.h" | 10 #include "src/bailout-reason.h" |
(...skipping 3971 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3982 formal_parameters, body, kind == kAsyncArrowFunction, CHECK_OK); | 3982 formal_parameters, body, kind == kAsyncArrowFunction, CHECK_OK); |
3983 ExpressionClassifier classifier(this); | 3983 ExpressionClassifier classifier(this); |
3984 if (kind == kAsyncArrowFunction) { | 3984 if (kind == kAsyncArrowFunction) { |
3985 ParseAsyncFunctionBody(scope(), body, kAsyncArrowFunction, | 3985 ParseAsyncFunctionBody(scope(), body, kAsyncArrowFunction, |
3986 FunctionBodyType::kSingleExpression, accept_IN, | 3986 FunctionBodyType::kSingleExpression, accept_IN, |
3987 pos, CHECK_OK); | 3987 pos, CHECK_OK); |
3988 impl()->RewriteNonPattern(CHECK_OK); | 3988 impl()->RewriteNonPattern(CHECK_OK); |
3989 } else { | 3989 } else { |
3990 ExpressionT expression = ParseAssignmentExpression(accept_IN, CHECK_OK); | 3990 ExpressionT expression = ParseAssignmentExpression(accept_IN, CHECK_OK); |
3991 impl()->RewriteNonPattern(CHECK_OK); | 3991 impl()->RewriteNonPattern(CHECK_OK); |
3992 body->Add(factory()->NewReturnStatement(expression, pos), zone()); | 3992 body->Add( |
| 3993 factory()->NewReturnStatement(expression, expression->position()), |
| 3994 zone()); |
3993 if (allow_tailcalls() && !is_sloppy(language_mode())) { | 3995 if (allow_tailcalls() && !is_sloppy(language_mode())) { |
3994 // ES6 14.6.1 Static Semantics: IsInTailPosition | 3996 // ES6 14.6.1 Static Semantics: IsInTailPosition |
3995 impl()->MarkTailPosition(expression); | 3997 impl()->MarkTailPosition(expression); |
3996 } | 3998 } |
3997 } | 3999 } |
3998 materialized_literal_count = function_state.materialized_literal_count(); | 4000 materialized_literal_count = function_state.materialized_literal_count(); |
3999 expected_property_count = function_state.expected_property_count(); | 4001 expected_property_count = function_state.expected_property_count(); |
4000 impl()->MarkCollectedTailCallExpressions(); | 4002 impl()->MarkCollectedTailCallExpressions(); |
4001 } | 4003 } |
4002 | 4004 |
(...skipping 1439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5442 has_seen_constructor_ = true; | 5444 has_seen_constructor_ = true; |
5443 return; | 5445 return; |
5444 } | 5446 } |
5445 } | 5447 } |
5446 | 5448 |
5447 | 5449 |
5448 } // namespace internal | 5450 } // namespace internal |
5449 } // namespace v8 | 5451 } // namespace v8 |
5450 | 5452 |
5451 #endif // V8_PARSING_PARSER_BASE_H | 5453 #endif // V8_PARSING_PARSER_BASE_H |
OLD | NEW |