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

Side by Side Diff: src/parser.h

Issue 798243004: ES6 computed property names (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Disable test on windows Created 5 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/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 395 matching lines...) Expand 10 before | Expand all | Expand 10 after
406 } 406 }
407 407
408 static bool IsBoilerplateProperty(ObjectLiteral::Property* property) { 408 static bool IsBoilerplateProperty(ObjectLiteral::Property* property) {
409 return ObjectLiteral::IsBoilerplateProperty(property); 409 return ObjectLiteral::IsBoilerplateProperty(property);
410 } 410 }
411 411
412 static bool IsArrayIndex(const AstRawString* string, uint32_t* index) { 412 static bool IsArrayIndex(const AstRawString* string, uint32_t* index) {
413 return string->AsArrayIndex(index); 413 return string->AsArrayIndex(index);
414 } 414 }
415 415
416 bool IsConstructorProperty(ObjectLiteral::Property* property) {
417 return property->key()->raw_value()->EqualsString(
418 ast_value_factory()->constructor_string());
419 }
420
421 static Expression* GetPropertyValue(ObjectLiteral::Property* property) { 416 static Expression* GetPropertyValue(ObjectLiteral::Property* property) {
422 return property->value(); 417 return property->value();
423 } 418 }
424 419
425 // Functions for encapsulating the differences between parsing and preparsing; 420 // Functions for encapsulating the differences between parsing and preparsing;
426 // operations interleaved with the recursive descent. 421 // operations interleaved with the recursive descent.
427 static void PushLiteralName(FuncNameInferrer* fni, const AstRawString* id) { 422 static void PushLiteralName(FuncNameInferrer* fni, const AstRawString* id) {
428 fni->PushLiteralName(id); 423 fni->PushLiteralName(id);
429 } 424 }
425
430 void PushPropertyName(FuncNameInferrer* fni, Expression* expression); 426 void PushPropertyName(FuncNameInferrer* fni, Expression* expression);
427
431 static void InferFunctionName(FuncNameInferrer* fni, 428 static void InferFunctionName(FuncNameInferrer* fni,
432 FunctionLiteral* func_to_infer) { 429 FunctionLiteral* func_to_infer) {
433 fni->AddFunction(func_to_infer); 430 fni->AddFunction(func_to_infer);
434 } 431 }
435 432
436 static void CheckFunctionLiteralInsideTopLevelObjectLiteral( 433 static void CheckFunctionLiteralInsideTopLevelObjectLiteral(
437 Scope* scope, ObjectLiteralProperty* property, bool* has_function) { 434 Scope* scope, ObjectLiteralProperty* property, bool* has_function) {
438 Expression* value = property->value(); 435 Expression* value = property->value();
439 if (scope->DeclarationScope()->is_script_scope() && 436 if (scope->DeclarationScope()->is_script_scope() &&
440 value->AsFunctionLiteral() != NULL) { 437 value->AsFunctionLiteral() != NULL) {
(...skipping 562 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
« 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