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

Side by Side Diff: src/parser.h

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 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
420 static Expression* GetPropertyValue(ObjectLiteral::Property* property) { 415 static Expression* GetPropertyValue(ObjectLiteral::Property* property) {
421 return property->value(); 416 return property->value();
422 } 417 }
423 418
424 // Functions for encapsulating the differences between parsing and preparsing; 419 // Functions for encapsulating the differences between parsing and preparsing;
425 // operations interleaved with the recursive descent. 420 // operations interleaved with the recursive descent.
426 static void PushLiteralName(FuncNameInferrer* fni, const AstRawString* id) { 421 static void PushLiteralName(FuncNameInferrer* fni, const AstRawString* id) {
427 fni->PushLiteralName(id); 422 fni->PushLiteralName(id);
428 } 423 }
424
429 void PushPropertyName(FuncNameInferrer* fni, Expression* expression); 425 void PushPropertyName(FuncNameInferrer* fni, Expression* expression);
426
430 static void InferFunctionName(FuncNameInferrer* fni, 427 static void InferFunctionName(FuncNameInferrer* fni,
431 FunctionLiteral* func_to_infer) { 428 FunctionLiteral* func_to_infer) {
432 fni->AddFunction(func_to_infer); 429 fni->AddFunction(func_to_infer);
433 } 430 }
434 431
435 static void CheckFunctionLiteralInsideTopLevelObjectLiteral( 432 static void CheckFunctionLiteralInsideTopLevelObjectLiteral(
436 Scope* scope, ObjectLiteralProperty* property, bool* has_function) { 433 Scope* scope, ObjectLiteralProperty* property, bool* has_function) {
437 Expression* value = property->value(); 434 Expression* value = property->value();
438 if (scope->DeclarationScope()->is_script_scope() && 435 if (scope->DeclarationScope()->is_script_scope() &&
439 value->AsFunctionLiteral() != NULL) { 436 value->AsFunctionLiteral() != NULL) {
(...skipping 563 matching lines...) Expand 10 before | Expand all | Expand 10 after
1003 } 1000 }
1004 1001
1005 1002
1006 Expression* ParserTraits::CloseTemplateLiteral(TemplateLiteralState* state, 1003 Expression* ParserTraits::CloseTemplateLiteral(TemplateLiteralState* state,
1007 int start, Expression* tag) { 1004 int start, Expression* tag) {
1008 return parser_->CloseTemplateLiteral(state, start, tag); 1005 return parser_->CloseTemplateLiteral(state, start, tag);
1009 } 1006 }
1010 } } // namespace v8::internal 1007 } } // namespace v8::internal
1011 1008
1012 #endif // V8_PARSER_H_ 1009 #endif // V8_PARSER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698