Index: src/ast.h |
diff --git a/src/ast.h b/src/ast.h |
index d562e91d981042edc30479fe125fe8fb8fda5bfd..30f4380e9de975f384dd57cfc43160b12dbbee93 100644 |
--- a/src/ast.h |
+++ b/src/ast.h |
@@ -1467,10 +1467,7 @@ class ObjectLiteralProperty FINAL : public ZoneObject { |
PROTOTYPE // Property is __proto__. |
}; |
- ObjectLiteralProperty(Zone* zone, AstValueFactory* ast_value_factory, |
- Literal* key, Expression* value, bool is_static); |
- |
- Literal* key() { return key_; } |
+ Expression* key() { return key_; } |
Expression* value() { return value_; } |
Kind kind() { return kind_; } |
@@ -1485,20 +1482,26 @@ class ObjectLiteralProperty FINAL : public ZoneObject { |
bool emit_store(); |
bool is_static() const { return is_static_; } |
+ bool is_computed_name() const { return is_computed_name_; } |
protected: |
friend class AstNodeFactory; |
- ObjectLiteralProperty(Zone* zone, bool is_getter, FunctionLiteral* value, |
- bool is_static); |
- void set_key(Literal* key) { key_ = key; } |
+ ObjectLiteralProperty(Zone* zone, AstValueFactory* ast_value_factory, |
+ Expression* key, Expression* value, bool is_static, |
+ bool is_computed_name); |
+ |
+ ObjectLiteralProperty(Zone* zone, bool is_getter, Expression* key, |
+ FunctionLiteral* value, bool is_static, |
+ bool is_computed_name); |
private: |
- Literal* key_; |
+ Expression* key_; |
Expression* value_; |
Kind kind_; |
bool emit_store_; |
bool is_static_; |
+ bool is_computed_name_; |
Handle<Map> receiver_type_; |
}; |
@@ -3379,20 +3382,21 @@ class AstNodeFactory FINAL BASE_EMBEDDED { |
boilerplate_properties, has_function, pos); |
} |
- ObjectLiteral::Property* NewObjectLiteralProperty(Literal* key, |
+ ObjectLiteral::Property* NewObjectLiteralProperty(Expression* key, |
Expression* value, |
- bool is_static) { |
- return new (zone_) ObjectLiteral::Property(zone_, ast_value_factory_, key, |
- value, is_static); |
+ bool is_static, |
+ bool is_computed_name) { |
+ return new (zone_) ObjectLiteral::Property( |
+ zone_, ast_value_factory_, key, value, is_static, is_computed_name); |
} |
ObjectLiteral::Property* NewObjectLiteralProperty(bool is_getter, |
+ Expression* key, |
FunctionLiteral* value, |
- int pos, bool is_static) { |
- ObjectLiteral::Property* prop = |
- new (zone_) ObjectLiteral::Property(zone_, is_getter, value, is_static); |
- prop->set_key(NewStringLiteral(value->raw_name(), pos)); |
- return prop; |
+ int pos, bool is_static, |
+ bool is_computed_name) { |
+ return new (zone_) ObjectLiteral::Property(zone_, is_getter, key, value, |
+ is_static, is_computed_name); |
} |
RegExpLiteral* NewRegExpLiteral(const AstRawString* pattern, |