| 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/base/hashmap.h" | 10 #include "src/base/hashmap.h" |
| (...skipping 2587 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2598 Scanner::Location sub_loc(sub_expression_pos, loc.end_pos); | 2598 Scanner::Location sub_loc(sub_expression_pos, loc.end_pos); |
| 2599 ReportMessageAt(sub_loc, MessageTemplate::kUnexpectedTailCallOfEval); | 2599 ReportMessageAt(sub_loc, MessageTemplate::kUnexpectedTailCallOfEval); |
| 2600 *ok = false; | 2600 *ok = false; |
| 2601 return Traits::EmptyExpression(); | 2601 return Traits::EmptyExpression(); |
| 2602 } | 2602 } |
| 2603 if (!is_strict(language_mode())) { | 2603 if (!is_strict(language_mode())) { |
| 2604 ReportMessageAt(loc, MessageTemplate::kUnexpectedSloppyTailCall); | 2604 ReportMessageAt(loc, MessageTemplate::kUnexpectedSloppyTailCall); |
| 2605 *ok = false; | 2605 *ok = false; |
| 2606 return Traits::EmptyExpression(); | 2606 return Traits::EmptyExpression(); |
| 2607 } | 2607 } |
| 2608 if (is_resumable()) { |
| 2609 Scanner::Location sub_loc(sub_expression_pos, loc.end_pos); |
| 2610 ReportMessageAt(sub_loc, MessageTemplate::kUnexpectedTailCall); |
| 2611 *ok = false; |
| 2612 return Traits::EmptyExpression(); |
| 2613 } |
| 2608 ReturnExprContext return_expr_context = | 2614 ReturnExprContext return_expr_context = |
| 2609 function_state_->return_expr_context(); | 2615 function_state_->return_expr_context(); |
| 2610 if (return_expr_context != ReturnExprContext::kInsideValidReturnStatement) { | 2616 if (return_expr_context != ReturnExprContext::kInsideValidReturnStatement) { |
| 2611 MessageTemplate::Template msg = MessageTemplate::kNone; | 2617 MessageTemplate::Template msg = MessageTemplate::kNone; |
| 2612 switch (return_expr_context) { | 2618 switch (return_expr_context) { |
| 2613 case ReturnExprContext::kInsideValidReturnStatement: | 2619 case ReturnExprContext::kInsideValidReturnStatement: |
| 2614 UNREACHABLE(); | 2620 UNREACHABLE(); |
| 2615 return Traits::EmptyExpression(); | 2621 return Traits::EmptyExpression(); |
| 2616 case ReturnExprContext::kInsideValidBlock: | 2622 case ReturnExprContext::kInsideValidBlock: |
| 2617 msg = MessageTemplate::kUnexpectedTailCall; | 2623 msg = MessageTemplate::kUnexpectedTailCall; |
| (...skipping 1107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3725 has_seen_constructor_ = true; | 3731 has_seen_constructor_ = true; |
| 3726 return; | 3732 return; |
| 3727 } | 3733 } |
| 3728 } | 3734 } |
| 3729 | 3735 |
| 3730 | 3736 |
| 3731 } // namespace internal | 3737 } // namespace internal |
| 3732 } // namespace v8 | 3738 } // namespace v8 |
| 3733 | 3739 |
| 3734 #endif // V8_PARSING_PARSER_BASE_H | 3740 #endif // V8_PARSING_PARSER_BASE_H |
| OLD | NEW |