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

Side by Side Diff: src/ast.h

Issue 703603005: Classes: Fix issue with default constructor crash (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: 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/parser.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 3604 matching lines...) Expand 10 before | Expand all | Expand 10 after
3615 ClassLiteral* NewClassLiteral(const AstRawString* name, Expression* extends, 3615 ClassLiteral* NewClassLiteral(const AstRawString* name, Expression* extends,
3616 Expression* constructor, 3616 Expression* constructor,
3617 ZoneList<ObjectLiteral::Property*>* properties, 3617 ZoneList<ObjectLiteral::Property*>* properties,
3618 int start_position, int end_position) { 3618 int start_position, int end_position) {
3619 ClassLiteral* lit = 3619 ClassLiteral* lit =
3620 new (zone_) ClassLiteral(zone_, name, extends, constructor, properties, 3620 new (zone_) ClassLiteral(zone_, name, extends, constructor, properties,
3621 start_position, end_position); 3621 start_position, end_position);
3622 VISIT_AND_RETURN(ClassLiteral, lit) 3622 VISIT_AND_RETURN(ClassLiteral, lit)
3623 } 3623 }
3624 3624
3625 FunctionLiteral* NewDefaultConstructor(const AstRawString* name,
3626 AstValueFactory* ast_value_factory,
3627 Scope* scope, int position) {
3628 ZoneList<Statement*>* body = new(zone_) ZoneList<Statement*>(0, zone_);
3629 int materialized_literal_count = 0;
3630 int expected_property_count = 0;
3631 int handler_count = 0;
3632 int parameter_count = 0;
3633
3634 FunctionLiteral::FunctionType function_type =
3635 FunctionLiteral::NAMED_EXPRESSION;
3636 if (name == NULL) {
3637 name = ast_value_factory->empty_string();
3638 function_type = FunctionLiteral::ANONYMOUS_EXPRESSION;
3639 }
3640
3641 return NewFunctionLiteral(name, ast_value_factory, scope, body,
3642 materialized_literal_count, expected_property_count, handler_count,
3643 parameter_count, FunctionLiteral::kNoDuplicateParameters,
3644 FunctionLiteral::ANONYMOUS_EXPRESSION, FunctionLiteral::kIsFunction,
3645 FunctionLiteral::kNotParenthesized, FunctionKind::kNormalFunction,
3646 position);
3647 }
3648
3649
3625 NativeFunctionLiteral* NewNativeFunctionLiteral(const AstRawString* name, 3650 NativeFunctionLiteral* NewNativeFunctionLiteral(const AstRawString* name,
3626 v8::Extension* extension, 3651 v8::Extension* extension,
3627 int pos) { 3652 int pos) {
3628 NativeFunctionLiteral* lit = 3653 NativeFunctionLiteral* lit =
3629 new (zone_) NativeFunctionLiteral(zone_, name, extension, pos); 3654 new (zone_) NativeFunctionLiteral(zone_, name, extension, pos);
3630 VISIT_AND_RETURN(NativeFunctionLiteral, lit) 3655 VISIT_AND_RETURN(NativeFunctionLiteral, lit)
3631 } 3656 }
3632 3657
3633 ThisFunction* NewThisFunction(int pos) { 3658 ThisFunction* NewThisFunction(int pos) {
3634 ThisFunction* fun = new (zone_) ThisFunction(zone_, pos); 3659 ThisFunction* fun = new (zone_) ThisFunction(zone_, pos);
(...skipping 10 matching lines...) Expand all
3645 private: 3670 private:
3646 Zone* zone_; 3671 Zone* zone_;
3647 Visitor visitor_; 3672 Visitor visitor_;
3648 AstValueFactory* ast_value_factory_; 3673 AstValueFactory* ast_value_factory_;
3649 }; 3674 };
3650 3675
3651 3676
3652 } } // namespace v8::internal 3677 } } // namespace v8::internal
3653 3678
3654 #endif // V8_AST_H_ 3679 #endif // V8_AST_H_
OLDNEW
« no previous file with comments | « no previous file | src/parser.cc » ('j') | src/parser.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698