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

Unified Diff: src/ast/scopes.h

Issue 2315733003: Class fields, part 1 (parsing and infrastructure) (Closed)
Patch Set: Created 4 years, 3 months 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
Index: src/ast/scopes.h
diff --git a/src/ast/scopes.h b/src/ast/scopes.h
index 96fcc5141be46124a8478b2e56723f516e9fd1ca..61228a2ec41bad28e166ffcb3941d5f91560396e 100644
--- a/src/ast/scopes.h
+++ b/src/ast/scopes.h
@@ -678,6 +678,10 @@ class DeclarationScope : public Scope {
// Returns the default function arity excluding default or rest parameters.
int default_function_length() const { return arity_; }
+ // Normal code should not need to call this. Class field initializers use this
+ // property to store information about the number of fields.
+ void set_default_function_length(int arity) { arity_ = arity; }
+
// Returns the number of formal parameters, excluding a possible rest
// parameter. Examples:
// function foo(a, b) {} ==> 2

Powered by Google App Engine
This is Rietveld 408576698