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

Side by Side Diff: src/parser.h

Issue 811593004: Revert of 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
« no previous file with comments | « src/ia32/full-codegen-ia32.cc ('k') | src/parser.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_PARSER_H_ 5 #ifndef V8_PARSER_H_
6 #define V8_PARSER_H_ 6 #define V8_PARSER_H_
7 7
8 #include "src/allocation.h" 8 #include "src/allocation.h"
9 #include "src/ast.h" 9 #include "src/ast.h"
10 #include "src/compiler.h" // For CachedDataMode 10 #include "src/compiler.h" // For CachedDataMode
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after
405 } 405 }
406 406
407 static bool IsBoilerplateProperty(ObjectLiteral::Property* property) { 407 static bool IsBoilerplateProperty(ObjectLiteral::Property* property) {
408 return ObjectLiteral::IsBoilerplateProperty(property); 408 return ObjectLiteral::IsBoilerplateProperty(property);
409 } 409 }
410 410
411 static bool IsArrayIndex(const AstRawString* string, uint32_t* index) { 411 static bool IsArrayIndex(const AstRawString* string, uint32_t* index) {
412 return string->AsArrayIndex(index); 412 return string->AsArrayIndex(index);
413 } 413 }
414 414
415 bool IsConstructorProperty(ObjectLiteral::Property* property) {
416 return property->key()->raw_value()->EqualsString(
417 ast_value_factory()->constructor_string());
418 }
419
415 static Expression* GetPropertyValue(ObjectLiteral::Property* property) { 420 static Expression* GetPropertyValue(ObjectLiteral::Property* property) {
416 return property->value(); 421 return property->value();
417 } 422 }
418 423
419 // Functions for encapsulating the differences between parsing and preparsing; 424 // Functions for encapsulating the differences between parsing and preparsing;
420 // operations interleaved with the recursive descent. 425 // operations interleaved with the recursive descent.
421 static void PushLiteralName(FuncNameInferrer* fni, const AstRawString* id) { 426 static void PushLiteralName(FuncNameInferrer* fni, const AstRawString* id) {
422 fni->PushLiteralName(id); 427 fni->PushLiteralName(id);
423 } 428 }
424
425 void PushPropertyName(FuncNameInferrer* fni, Expression* expression); 429 void PushPropertyName(FuncNameInferrer* fni, Expression* expression);
426
427 static void InferFunctionName(FuncNameInferrer* fni, 430 static void InferFunctionName(FuncNameInferrer* fni,
428 FunctionLiteral* func_to_infer) { 431 FunctionLiteral* func_to_infer) {
429 fni->AddFunction(func_to_infer); 432 fni->AddFunction(func_to_infer);
430 } 433 }
431 434
432 static void CheckFunctionLiteralInsideTopLevelObjectLiteral( 435 static void CheckFunctionLiteralInsideTopLevelObjectLiteral(
433 Scope* scope, ObjectLiteralProperty* property, bool* has_function) { 436 Scope* scope, ObjectLiteralProperty* property, bool* has_function) {
434 Expression* value = property->value(); 437 Expression* value = property->value();
435 if (scope->DeclarationScope()->is_script_scope() && 438 if (scope->DeclarationScope()->is_script_scope() &&
436 value->AsFunctionLiteral() != NULL) { 439 value->AsFunctionLiteral() != NULL) {
(...skipping 563 matching lines...) Expand 10 before | Expand all | Expand 10 after
1000 } 1003 }
1001 1004
1002 1005
1003 Expression* ParserTraits::CloseTemplateLiteral(TemplateLiteralState* state, 1006 Expression* ParserTraits::CloseTemplateLiteral(TemplateLiteralState* state,
1004 int start, Expression* tag) { 1007 int start, Expression* tag) {
1005 return parser_->CloseTemplateLiteral(state, start, tag); 1008 return parser_->CloseTemplateLiteral(state, start, tag);
1006 } 1009 }
1007 } } // namespace v8::internal 1010 } } // namespace v8::internal
1008 1011
1009 #endif // V8_PARSER_H_ 1012 #endif // V8_PARSER_H_
OLDNEW
« no previous file with comments | « src/ia32/full-codegen-ia32.cc ('k') | src/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698