Scope* scope() const { return scope_; }
VariableProxy* class_variable_proxy() const { return class_variable_proxy_; }
Expression* extends() const { return extends_; }
- Expression* constructor() const { return constructor_; }
+ FunctionLiteral* constructor() const { return constructor_; }
ZoneList<Property*>* properties() const { return properties_; }
int start_position() const { return position(); }
int end_position() const { return end_position_; }
protected:
ClassLiteral(Zone* zone, const AstRawString* name, Scope* scope,
VariableProxy* class_variable_proxy, Expression* extends,
- Expression* constructor, ZoneList<Property*>* properties,
+ FunctionLiteral* constructor, ZoneList<Property*>* properties,
int start_position, int end_position)
: Expression(zone, start_position),
raw_name_(name),
Scope* scope_;
VariableProxy* class_variable_proxy_;
Expression* extends_;
- Expression* constructor_;
+ FunctionLiteral* constructor_;
ZoneList<Property*>* properties_;
int end_position_;
};
ClassLiteral* NewClassLiteral(const AstRawString* name, Scope* scope,
VariableProxy* proxy, Expression* extends,
- Expression* constructor,
+ FunctionLiteral* constructor,
ZoneList<ObjectLiteral::Property*>* properties,
int start_position, int end_position) {
return new (zone_)
}
ZoneList<ObjectLiteral::Property*>* properties = NewPropertyList(4, zone());
- Expression* constructor = NULL;
+ FunctionLiteral* constructor = NULL;
bool has_seen_constructor = false;
Expect(Token::LBRACE, CHECK_OK);
&has_seen_constructor, CHECK_OK);
if (has_seen_constructor && constructor == NULL) {
- constructor = GetPropertyValue(property);
+ constructor = GetPropertyValue(property)->AsFunctionLiteral();
+ DCHECK_NOT_NULL(constructor);
} else {
properties->Add(property, zone());
}