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 #include "src/parsing/parser.h" | 5 #include "src/parsing/parser.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "src/api.h" | 9 #include "src/api.h" |
10 #include "src/ast/ast-expression-rewriter.h" | 10 #include "src/ast/ast-expression-rewriter.h" |
(...skipping 2487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2498 factory()->NewUndefinedLiteral(kNoSourcePosition), pos); | 2498 factory()->NewUndefinedLiteral(kNoSourcePosition), pos); |
2499 | 2499 |
2500 // is_undefined ? this : is_object_conditional | 2500 // is_undefined ? this : is_object_conditional |
2501 return_value = factory()->NewConditional( | 2501 return_value = factory()->NewConditional( |
2502 is_undefined, ThisExpression(pos), is_object_conditional, pos); | 2502 is_undefined, ThisExpression(pos), is_object_conditional, pos); |
2503 } else { | 2503 } else { |
2504 ReturnExprScope maybe_allow_tail_calls( | 2504 ReturnExprScope maybe_allow_tail_calls( |
2505 function_state_, ReturnExprContext::kInsideValidReturnStatement); | 2505 function_state_, ReturnExprContext::kInsideValidReturnStatement); |
2506 return_value = ParseExpression(true, CHECK_OK); | 2506 return_value = ParseExpression(true, CHECK_OK); |
2507 | 2507 |
2508 if (allow_tailcalls() && !is_sloppy(language_mode())) { | 2508 if (allow_tailcalls() && !is_sloppy(language_mode()) && !is_resumable()) { |
2509 // ES6 14.6.1 Static Semantics: IsInTailPosition | 2509 // ES6 14.6.1 Static Semantics: IsInTailPosition |
2510 function_state_->AddImplicitTailCallExpression(return_value); | 2510 function_state_->AddImplicitTailCallExpression(return_value); |
2511 } | 2511 } |
2512 } | 2512 } |
2513 } | 2513 } |
2514 ExpectSemicolon(CHECK_OK); | 2514 ExpectSemicolon(CHECK_OK); |
2515 | 2515 |
2516 if (is_generator()) { | 2516 if (is_generator()) { |
2517 return_value = BuildIteratorResult(return_value, true); | 2517 return_value = BuildIteratorResult(return_value, true); |
2518 } else if (is_async_function()) { | 2518 } else if (is_async_function()) { |
(...skipping 4204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6723 node->Print(Isolate::Current()); | 6723 node->Print(Isolate::Current()); |
6724 } | 6724 } |
6725 #endif // DEBUG | 6725 #endif // DEBUG |
6726 | 6726 |
6727 #undef CHECK_OK | 6727 #undef CHECK_OK |
6728 #undef CHECK_OK_VOID | 6728 #undef CHECK_OK_VOID |
6729 #undef CHECK_FAILED | 6729 #undef CHECK_FAILED |
6730 | 6730 |
6731 } // namespace internal | 6731 } // namespace internal |
6732 } // namespace v8 | 6732 } // namespace v8 |
OLD | NEW |