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

Side by Side Diff: src/preparser.cc

Issue 807173002: ES6 computed property names (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 6 years 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
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 972 matching lines...) Expand 10 before | Expand all | Expand 10 after
983 ParseLeftHandSideExpression(CHECK_OK); 983 ParseLeftHandSideExpression(CHECK_OK);
984 } 984 }
985 985
986 bool has_seen_constructor = false; 986 bool has_seen_constructor = false;
987 987
988 Expect(Token::LBRACE, CHECK_OK); 988 Expect(Token::LBRACE, CHECK_OK);
989 while (peek() != Token::RBRACE) { 989 while (peek() != Token::RBRACE) {
990 if (Check(Token::SEMICOLON)) continue; 990 if (Check(Token::SEMICOLON)) continue;
991 const bool in_class = true; 991 const bool in_class = true;
992 const bool is_static = false; 992 const bool is_static = false;
993 ParsePropertyDefinition(NULL, in_class, is_static, &has_seen_constructor, 993 bool is_computed_name = false; // Classes do not care about computed
994 CHECK_OK); 994 // property names here.
995 ParsePropertyDefinition(NULL, in_class, is_static, &is_computed_name,
996 &has_seen_constructor, CHECK_OK);
995 } 997 }
996 998
997 Expect(Token::RBRACE, CHECK_OK); 999 Expect(Token::RBRACE, CHECK_OK);
998 1000
999 return Expression::Default(); 1001 return Expression::Default();
1000 } 1002 }
1001 1003
1002 1004
1003 PreParser::Expression PreParser::ParseV8Intrinsic(bool* ok) { 1005 PreParser::Expression PreParser::ParseV8Intrinsic(bool* ok) {
1004 // CallRuntime :: 1006 // CallRuntime ::
1005 // '%' Identifier Arguments 1007 // '%' Identifier Arguments
1006 Expect(Token::MOD, CHECK_OK); 1008 Expect(Token::MOD, CHECK_OK);
1007 if (!allow_natives()) { 1009 if (!allow_natives()) {
1008 *ok = false; 1010 *ok = false;
1009 return Expression::Default(); 1011 return Expression::Default();
1010 } 1012 }
1011 // Allow "eval" or "arguments" for backward compatibility. 1013 // Allow "eval" or "arguments" for backward compatibility.
1012 ParseIdentifier(kAllowEvalOrArguments, CHECK_OK); 1014 ParseIdentifier(kAllowEvalOrArguments, CHECK_OK);
1013 ParseArguments(ok); 1015 ParseArguments(ok);
1014 1016
1015 return Expression::Default(); 1017 return Expression::Default();
1016 } 1018 }
1017 1019
1018 #undef CHECK_OK 1020 #undef CHECK_OK
1019 1021
1020 1022
1021 } } // v8::internal 1023 } } // v8::internal
OLDNEW
« src/ia32/full-codegen-ia32.cc ('K') | « src/preparser.h ('k') | src/runtime.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698