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

Unified Diff: src/scopes.h

Issue 766663003: harmony-classes: Implement 'super(...)' call syntactic restriction. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Patch for landing 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 side-by-side diff with in-line comments
Download patch
Index: src/scopes.h
diff --git a/src/scopes.h b/src/scopes.h
index 4975ab4abf632529e2ffbf0f9eb377884aa84141..8d790068783c20e681248972c91dbce176d1848f 100644
--- a/src/scopes.h
+++ b/src/scopes.h
@@ -214,7 +214,12 @@ class Scope: public ZoneObject {
void RecordArgumentsUsage() { scope_uses_arguments_ = true; }
// Inform the scope that the corresponding code uses "super".
- void RecordSuperUsage() { scope_uses_super_ = true; }
+ void RecordSuperPropertyUsage() { scope_uses_super_property_ = true; }
+
+ // Inform the scope that the corresponding code invokes "super" constructor.
+ void RecordSuperConstructorCallUsage() {
+ scope_uses_super_constructor_call_ = true;
+ }
// Inform the scope that the corresponding code uses "this".
void RecordThisUsage() { scope_uses_this_ = true; }
@@ -307,10 +312,20 @@ class Scope: public ZoneObject {
bool uses_arguments() const { return scope_uses_arguments_; }
// Does any inner scope access "arguments".
bool inner_uses_arguments() const { return inner_scope_uses_arguments_; }
- // Does this scope access "super".
- bool uses_super() const { return scope_uses_super_; }
- // Does any inner scope access "super".
- bool inner_uses_super() const { return inner_scope_uses_super_; }
+ // Does this scope access "super" property (super.foo).
+ bool uses_super_property() const { return scope_uses_super_property_; }
+ // Does any inner scope access "super" property.
+ bool inner_uses_super_property() const {
+ return inner_scope_uses_super_property_;
+ }
+ // Does this scope calls "super" constructor.
+ bool uses_super_constructor_call() const {
+ return scope_uses_super_constructor_call_;
+ }
+ // Does any inner scope calls "super" constructor.
+ bool inner_uses_super_constructor_call() const {
+ return inner_scope_uses_super_constructor_call_;
+ }
// Does this scope access "this".
bool uses_this() const { return scope_uses_this_; }
// Does any inner scope access "this".
@@ -496,8 +511,10 @@ class Scope: public ZoneObject {
bool scope_calls_eval_;
// This scope uses "arguments".
bool scope_uses_arguments_;
- // This scope uses "super".
- bool scope_uses_super_;
+ // This scope uses "super" property ('super.foo').
+ bool scope_uses_super_property_;
+ // This scope uses "super" constructor ('super(..)').
+ bool scope_uses_super_constructor_call_;
// This scope uses "this".
bool scope_uses_this_;
// This scope contains an "use asm" annotation.
@@ -514,7 +531,8 @@ class Scope: public ZoneObject {
bool outer_scope_calls_sloppy_eval_;
bool inner_scope_calls_eval_;
bool inner_scope_uses_arguments_;
- bool inner_scope_uses_super_;
+ bool inner_scope_uses_super_property_;
+ bool inner_scope_uses_super_constructor_call_;
bool inner_scope_uses_this_;
bool force_eager_compilation_;
bool force_context_allocation_;

Powered by Google App Engine
This is Rietveld 408576698