Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Side by Side Diff: src/preparser.h

Issue 1180943007: [strong] Make strong 'this' optional for experimentation (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Comments Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/parser.cc ('k') | src/preparser.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 2046 matching lines...) Expand 10 before | Expand all | Expand 10 after
2057 // TemplateLiteral 2057 // TemplateLiteral
2058 2058
2059 int beg_pos = scanner()->peek_location().beg_pos; 2059 int beg_pos = scanner()->peek_location().beg_pos;
2060 int end_pos = scanner()->peek_location().end_pos; 2060 int end_pos = scanner()->peek_location().end_pos;
2061 ExpressionT result = this->EmptyExpression(); 2061 ExpressionT result = this->EmptyExpression();
2062 Token::Value token = peek(); 2062 Token::Value token = peek();
2063 switch (token) { 2063 switch (token) {
2064 case Token::THIS: { 2064 case Token::THIS: {
2065 BindingPatternUnexpectedToken(classifier); 2065 BindingPatternUnexpectedToken(classifier);
2066 Consume(Token::THIS); 2066 Consume(Token::THIS);
2067 if (is_strong(language_mode())) { 2067 if (FLAG_strong_this && is_strong(language_mode())) {
2068 // Constructors' usages of 'this' in strong mode are parsed separately. 2068 // Constructors' usages of 'this' in strong mode are parsed separately.
2069 // TODO(rossberg): this does not work with arrow functions yet. 2069 // TODO(rossberg): this does not work with arrow functions yet.
2070 if (i::IsConstructor(function_state_->kind())) { 2070 if (i::IsConstructor(function_state_->kind())) {
2071 ReportMessage(MessageTemplate::kStrongConstructorThis); 2071 ReportMessage(MessageTemplate::kStrongConstructorThis);
2072 *ok = false; 2072 *ok = false;
2073 break; 2073 break;
2074 } 2074 }
2075 } 2075 }
2076 result = this->ThisExpression(scope_, factory(), beg_pos); 2076 result = this->ThisExpression(scope_, factory(), beg_pos);
2077 break; 2077 break;
(...skipping 1768 matching lines...) Expand 10 before | Expand all | Expand 10 after
3846 *ok = false; 3846 *ok = false;
3847 return; 3847 return;
3848 } 3848 }
3849 has_seen_constructor_ = true; 3849 has_seen_constructor_ = true;
3850 return; 3850 return;
3851 } 3851 }
3852 } 3852 }
3853 } } // v8::internal 3853 } } // v8::internal
3854 3854
3855 #endif // V8_PREPARSER_H 3855 #endif // V8_PREPARSER_H
OLDNEW
« no previous file with comments | « src/parser.cc ('k') | src/preparser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698