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_PREPARSER_H | 5 #ifndef V8_PREPARSER_H |
6 #define V8_PREPARSER_H | 6 #define V8_PREPARSER_H |
7 | 7 |
8 #include "src/v8.h" | 8 #include "src/v8.h" |
9 | 9 |
10 #include "src/bailout-reason.h" | 10 #include "src/bailout-reason.h" |
(...skipping 2790 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2801 result = factory()->NewProperty(result, index, pos); | 2801 result = factory()->NewProperty(result, index, pos); |
2802 Expect(Token::RBRACK, CHECK_OK); | 2802 Expect(Token::RBRACK, CHECK_OK); |
2803 break; | 2803 break; |
2804 } | 2804 } |
2805 | 2805 |
2806 case Token::LPAREN: { | 2806 case Token::LPAREN: { |
2807 int pos; | 2807 int pos; |
2808 if (scanner()->current_token() == Token::IDENTIFIER) { | 2808 if (scanner()->current_token() == Token::IDENTIFIER) { |
2809 // For call of an identifier we want to report position of | 2809 // For call of an identifier we want to report position of |
2810 // the identifier as position of the call in the stack trace. | 2810 // the identifier as position of the call in the stack trace. |
| 2811 if (is_strong(language_mode()) && this->IsIdentifier(result) && |
| 2812 this->IsEval(this->AsIdentifier(result))) { |
| 2813 ReportMessage("strong_direct_eval"); |
| 2814 *ok = false; |
| 2815 return this->EmptyExpression(); |
| 2816 } |
2811 pos = position(); | 2817 pos = position(); |
2812 } else { | 2818 } else { |
2813 // For other kinds of calls we record position of the parenthesis as | 2819 // For other kinds of calls we record position of the parenthesis as |
2814 // position of the call. Note that this is extremely important for | 2820 // position of the call. Note that this is extremely important for |
2815 // expressions of the form function(){...}() for which call position | 2821 // expressions of the form function(){...}() for which call position |
2816 // should not point to the closing brace otherwise it will intersect | 2822 // should not point to the closing brace otherwise it will intersect |
2817 // with positions recorded for function literal and confuse debugger. | 2823 // with positions recorded for function literal and confuse debugger. |
2818 pos = peek_position(); | 2824 pos = peek_position(); |
2819 // Also the trailing parenthesis are a hint that the function will | 2825 // Also the trailing parenthesis are a hint that the function will |
2820 // be called immediately. If we happen to have parsed a preceding | 2826 // be called immediately. If we happen to have parsed a preceding |
(...skipping 640 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3461 *ok = false; | 3467 *ok = false; |
3462 return; | 3468 return; |
3463 } | 3469 } |
3464 has_seen_constructor_ = true; | 3470 has_seen_constructor_ = true; |
3465 return; | 3471 return; |
3466 } | 3472 } |
3467 } | 3473 } |
3468 } } // v8::internal | 3474 } } // v8::internal |
3469 | 3475 |
3470 #endif // V8_PREPARSER_H | 3476 #endif // V8_PREPARSER_H |
OLD | NEW |