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

Unified Diff: src/ast/ast.h

Issue 2423053002: Install the 'name' property in classes at runtime (Closed)
Patch Set: Check for 'name' properties at parse-time Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/ast/ast-value-factory.h » ('j') | src/interpreter/bytecode-generator.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ast/ast.h
diff --git a/src/ast/ast.h b/src/ast/ast.h
index e6e2a368631409e5c14143d4752477afc2a1fc7c..91e166ff499f08d288657eacb8f380f8f0b74da8 100644
--- a/src/ast/ast.h
+++ b/src/ast/ast.h
@@ -2800,6 +2800,7 @@ class ClassLiteral final : public Expression {
ZoneList<Property*>* properties() const { return properties_; }
int start_position() const { return position(); }
int end_position() const { return end_position_; }
+ bool has_name_static_property() const { return has_name_static_property_; }
VariableProxy* static_initializer_proxy() const {
return static_initializer_proxy_;
@@ -2836,14 +2837,16 @@ class ClassLiteral final : public Expression {
ClassLiteral(VariableProxy* class_variable_proxy, Expression* extends,
FunctionLiteral* constructor, ZoneList<Property*>* properties,
- int start_position, int end_position)
+ int start_position, int end_position,
+ bool has_name_static_property)
: Expression(start_position, kClassLiteral),
end_position_(end_position),
class_variable_proxy_(class_variable_proxy),
extends_(extends),
constructor_(constructor),
properties_(properties),
- static_initializer_proxy_(nullptr) {}
+ static_initializer_proxy_(nullptr),
+ has_name_static_property_(has_name_static_property) {}
static int parent_num_ids() { return Expression::num_ids(); }
int local_id(int n) const { return base_id() + parent_num_ids() + n; }
@@ -2856,6 +2859,7 @@ class ClassLiteral final : public Expression {
FunctionLiteral* constructor_;
ZoneList<Property*>* properties_;
VariableProxy* static_initializer_proxy_;
+ bool has_name_static_property_;
Toon Verwaest 2016/11/28 10:40:58 This should be added to the bitfield provided by A
};
@@ -3492,9 +3496,11 @@ class AstNodeFactory final BASE_EMBEDDED {
ClassLiteral* NewClassLiteral(VariableProxy* proxy, Expression* extends,
FunctionLiteral* constructor,
ZoneList<ClassLiteral::Property*>* properties,
- int start_position, int end_position) {
- return new (zone_) ClassLiteral(proxy, extends, constructor, properties,
- start_position, end_position);
+ int start_position, int end_position,
+ bool has_name_static_property) {
+ return new (zone_)
+ ClassLiteral(proxy, extends, constructor, properties, start_position,
+ end_position, has_name_static_property);
}
NativeFunctionLiteral* NewNativeFunctionLiteral(const AstRawString* name,
« no previous file with comments | « no previous file | src/ast/ast-value-factory.h » ('j') | src/interpreter/bytecode-generator.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698