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

Side by Side Diff: src/ast.h

Issue 722793005: Classes: Implement correct name binding (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: git rebase Created 6 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | src/ast-numbering.cc » ('j') | src/parser.cc » ('J')
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_AST_H_ 5 #ifndef V8_AST_H_
6 #define V8_AST_H_ 6 #define V8_AST_H_
7 7
8 #include "src/v8.h" 8 #include "src/v8.h"
9 9
10 #include "src/assembler.h" 10 #include "src/assembler.h"
(...skipping 2623 matching lines...) Expand 10 before | Expand all | Expand 10 after
2634 2634
2635 2635
2636 class ClassLiteral FINAL : public Expression { 2636 class ClassLiteral FINAL : public Expression {
2637 public: 2637 public:
2638 typedef ObjectLiteralProperty Property; 2638 typedef ObjectLiteralProperty Property;
2639 2639
2640 DECLARE_NODE_TYPE(ClassLiteral) 2640 DECLARE_NODE_TYPE(ClassLiteral)
2641 2641
2642 Handle<String> name() const { return raw_name_->string(); } 2642 Handle<String> name() const { return raw_name_->string(); }
2643 const AstRawString* raw_name() const { return raw_name_; } 2643 const AstRawString* raw_name() const { return raw_name_; }
2644 Scope* scope() const { return scope_; }
2645 VariableProxy* class_variable_proxy() const { return class_variable_proxy_; }
2644 Expression* extends() const { return extends_; } 2646 Expression* extends() const { return extends_; }
2645 Expression* constructor() const { return constructor_; } 2647 Expression* constructor() const { return constructor_; }
2646 ZoneList<Property*>* properties() const { return properties_; } 2648 ZoneList<Property*>* properties() const { return properties_; }
2647 int start_position() const { return position(); } 2649 int start_position() const { return position(); }
2648 int end_position() const { return end_position_; } 2650 int end_position() const { return end_position_; }
2649 2651
2650 protected: 2652 protected:
2651 ClassLiteral(Zone* zone, const AstRawString* name, Expression* extends, 2653 ClassLiteral(Zone* zone, const AstRawString* name, Scope* scope,
2654 VariableProxy* class_variable_proxy, Expression* extends,
2652 Expression* constructor, ZoneList<Property*>* properties, 2655 Expression* constructor, ZoneList<Property*>* properties,
2653 int start_position, int end_position) 2656 int start_position, int end_position)
2654 : Expression(zone, start_position), 2657 : Expression(zone, start_position),
2655 raw_name_(name), 2658 raw_name_(name),
2659 scope_(scope),
2660 class_variable_proxy_(class_variable_proxy),
2656 extends_(extends), 2661 extends_(extends),
2657 constructor_(constructor), 2662 constructor_(constructor),
2658 properties_(properties), 2663 properties_(properties),
2659 end_position_(end_position) {} 2664 end_position_(end_position) {}
2660 2665
2661 private: 2666 private:
2662 const AstRawString* raw_name_; 2667 const AstRawString* raw_name_;
2668 Scope* scope_;
2669 VariableProxy* class_variable_proxy_;
2663 Expression* extends_; 2670 Expression* extends_;
2664 Expression* constructor_; 2671 Expression* constructor_;
2665 ZoneList<Property*>* properties_; 2672 ZoneList<Property*>* properties_;
2666 int end_position_; 2673 int end_position_;
2667 }; 2674 };
2668 2675
2669 2676
2670 class NativeFunctionLiteral FINAL : public Expression { 2677 class NativeFunctionLiteral FINAL : public Expression {
2671 public: 2678 public:
2672 DECLARE_NODE_TYPE(NativeFunctionLiteral) 2679 DECLARE_NODE_TYPE(NativeFunctionLiteral)
(...skipping 820 matching lines...) Expand 10 before | Expand all | Expand 10 after
3493 FunctionLiteral::IsFunctionFlag is_function, 3500 FunctionLiteral::IsFunctionFlag is_function,
3494 FunctionLiteral::IsParenthesizedFlag is_parenthesized, FunctionKind kind, 3501 FunctionLiteral::IsParenthesizedFlag is_parenthesized, FunctionKind kind,
3495 int position) { 3502 int position) {
3496 return new (zone_) FunctionLiteral( 3503 return new (zone_) FunctionLiteral(
3497 zone_, name, ast_value_factory, scope, body, materialized_literal_count, 3504 zone_, name, ast_value_factory, scope, body, materialized_literal_count,
3498 expected_property_count, handler_count, parameter_count, function_type, 3505 expected_property_count, handler_count, parameter_count, function_type,
3499 has_duplicate_parameters, is_function, is_parenthesized, kind, 3506 has_duplicate_parameters, is_function, is_parenthesized, kind,
3500 position); 3507 position);
3501 } 3508 }
3502 3509
3503 ClassLiteral* NewClassLiteral(const AstRawString* name, Expression* extends, 3510 ClassLiteral* NewClassLiteral(const AstRawString* name, Scope* scope,
3511 VariableProxy* proxy, Expression* extends,
3504 Expression* constructor, 3512 Expression* constructor,
3505 ZoneList<ObjectLiteral::Property*>* properties, 3513 ZoneList<ObjectLiteral::Property*>* properties,
3506 int start_position, int end_position) { 3514 int start_position, int end_position) {
3507 return new (zone_) ClassLiteral(zone_, name, extends, constructor, 3515 return new (zone_)
3508 properties, start_position, end_position); 3516 ClassLiteral(zone_, name, scope, proxy, extends, constructor,
3517 properties, start_position, end_position);
3509 } 3518 }
3510 3519
3511 NativeFunctionLiteral* NewNativeFunctionLiteral(const AstRawString* name, 3520 NativeFunctionLiteral* NewNativeFunctionLiteral(const AstRawString* name,
3512 v8::Extension* extension, 3521 v8::Extension* extension,
3513 int pos) { 3522 int pos) {
3514 return new (zone_) NativeFunctionLiteral(zone_, name, extension, pos); 3523 return new (zone_) NativeFunctionLiteral(zone_, name, extension, pos);
3515 } 3524 }
3516 3525
3517 ThisFunction* NewThisFunction(int pos) { 3526 ThisFunction* NewThisFunction(int pos) {
3518 return new (zone_) ThisFunction(zone_, pos); 3527 return new (zone_) ThisFunction(zone_, pos);
3519 } 3528 }
3520 3529
3521 SuperReference* NewSuperReference(VariableProxy* this_var, int pos) { 3530 SuperReference* NewSuperReference(VariableProxy* this_var, int pos) {
3522 return new (zone_) SuperReference(zone_, this_var, pos); 3531 return new (zone_) SuperReference(zone_, this_var, pos);
3523 } 3532 }
3524 3533
3525 private: 3534 private:
3526 Zone* zone_; 3535 Zone* zone_;
3527 AstValueFactory* ast_value_factory_; 3536 AstValueFactory* ast_value_factory_;
3528 }; 3537 };
3529 3538
3530 3539
3531 } } // namespace v8::internal 3540 } } // namespace v8::internal
3532 3541
3533 #endif // V8_AST_H_ 3542 #endif // V8_AST_H_
OLDNEW
« no previous file with comments | « no previous file | src/ast-numbering.cc » ('j') | src/parser.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698