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

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

Issue 1563923002: [es6] Handle function names in object and class literals (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Handled review comments Created 4 years, 11 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/preparser.h ('k') | test/mjsunit/harmony/function-name.js » ('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 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 1215 matching lines...) Expand 10 before | Expand all | Expand 10 after
1226 ClassLiteralChecker checker(this); 1226 ClassLiteralChecker checker(this);
1227 bool has_seen_constructor = false; 1227 bool has_seen_constructor = false;
1228 1228
1229 Expect(Token::LBRACE, CHECK_OK); 1229 Expect(Token::LBRACE, CHECK_OK);
1230 while (peek() != Token::RBRACE) { 1230 while (peek() != Token::RBRACE) {
1231 if (Check(Token::SEMICOLON)) continue; 1231 if (Check(Token::SEMICOLON)) continue;
1232 const bool in_class = true; 1232 const bool in_class = true;
1233 const bool is_static = false; 1233 const bool is_static = false;
1234 bool is_computed_name = false; // Classes do not care about computed 1234 bool is_computed_name = false; // Classes do not care about computed
1235 // property names here. 1235 // property names here.
1236 Identifier name;
1236 ExpressionClassifier classifier; 1237 ExpressionClassifier classifier;
1237 ParsePropertyDefinition(&checker, in_class, has_extends, is_static, 1238 ParsePropertyDefinition(&checker, in_class, has_extends, is_static,
1238 &is_computed_name, &has_seen_constructor, 1239 &is_computed_name, &has_seen_constructor,
1239 &classifier, CHECK_OK); 1240 &classifier, &name, CHECK_OK);
1240 ValidateExpression(&classifier, CHECK_OK); 1241 ValidateExpression(&classifier, CHECK_OK);
1241 } 1242 }
1242 1243
1243 Expect(Token::RBRACE, CHECK_OK); 1244 Expect(Token::RBRACE, CHECK_OK);
1244 1245
1245 return Expression::Default(); 1246 return Expression::Default();
1246 } 1247 }
1247 1248
1248 1249
1249 PreParser::Expression PreParser::ParseV8Intrinsic(bool* ok) { 1250 PreParser::Expression PreParser::ParseV8Intrinsic(bool* ok) {
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
1281 Expect(Token::RBRACE, CHECK_OK); 1282 Expect(Token::RBRACE, CHECK_OK);
1282 return PreParserExpression::Default(); 1283 return PreParserExpression::Default();
1283 } 1284 }
1284 } 1285 }
1285 1286
1286 #undef CHECK_OK 1287 #undef CHECK_OK
1287 1288
1288 1289
1289 } // namespace internal 1290 } // namespace internal
1290 } // namespace v8 1291 } // namespace v8
OLDNEW
« no previous file with comments | « src/parsing/preparser.h ('k') | test/mjsunit/harmony/function-name.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698