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

Side by Side Diff: src/parsing/preparser.cc

Issue 2295743003: Revert of Refactor object/class literal property name parsing (Closed)
Patch Set: Created 4 years, 3 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/parsing/parser-base.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 <cmath> 5 #include <cmath>
6 6
7 #include "src/allocation.h" 7 #include "src/allocation.h"
8 #include "src/base/logging.h" 8 #include "src/base/logging.h"
9 #include "src/conversions-inl.h" 9 #include "src/conversions-inl.h"
10 #include "src/conversions.h" 10 #include "src/conversions.h"
(...skipping 1166 matching lines...) Expand 10 before | Expand all | Expand 10 after
1177 bool has_seen_constructor = false; 1177 bool has_seen_constructor = false;
1178 1178
1179 Expect(Token::LBRACE, CHECK_OK); 1179 Expect(Token::LBRACE, CHECK_OK);
1180 while (peek() != Token::RBRACE) { 1180 while (peek() != Token::RBRACE) {
1181 if (Check(Token::SEMICOLON)) continue; 1181 if (Check(Token::SEMICOLON)) continue;
1182 const bool in_class = true; 1182 const bool in_class = true;
1183 bool is_computed_name = false; // Classes do not care about computed 1183 bool is_computed_name = false; // Classes do not care about computed
1184 // property names here. 1184 // property names here.
1185 Identifier name; 1185 Identifier name;
1186 ExpressionClassifier property_classifier(this); 1186 ExpressionClassifier property_classifier(this);
1187 ParsePropertyDefinition(&checker, in_class, has_extends, &is_computed_name, 1187 ParsePropertyDefinition(
1188 &has_seen_constructor, &property_classifier, &name, 1188 &checker, in_class, has_extends, MethodKind::kNormal, &is_computed_name,
1189 CHECK_OK); 1189 &has_seen_constructor, &property_classifier, &name, CHECK_OK);
1190 ValidateExpression(&property_classifier, CHECK_OK); 1190 ValidateExpression(&property_classifier, CHECK_OK);
1191 if (classifier != nullptr) { 1191 if (classifier != nullptr) {
1192 classifier->AccumulateFormalParameterContainmentErrors( 1192 classifier->AccumulateFormalParameterContainmentErrors(
1193 &property_classifier); 1193 &property_classifier);
1194 } 1194 }
1195 } 1195 }
1196 1196
1197 Expect(Token::RBRACE, CHECK_OK); 1197 Expect(Token::RBRACE, CHECK_OK);
1198 1198
1199 return Expression::Default(); 1199 return Expression::Default();
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
1243 1243
1244 body->Add(PreParserStatement::ExpressionStatement(return_value), zone()); 1244 body->Add(PreParserStatement::ExpressionStatement(return_value), zone());
1245 } 1245 }
1246 1246
1247 #undef CHECK_OK 1247 #undef CHECK_OK
1248 #undef CHECK_OK_CUSTOM 1248 #undef CHECK_OK_CUSTOM
1249 1249
1250 1250
1251 } // namespace internal 1251 } // namespace internal
1252 } // namespace v8 1252 } // namespace v8
OLDNEW
« no previous file with comments | « src/parsing/parser-base.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698