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

Unified Diff: src/scopes.cc

Issue 867153003: new classes: special construct stub for derived classs and TDZ for `this`. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: CR feedback Created 5 years, 11 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/scopes.cc
diff --git a/src/scopes.cc b/src/scopes.cc
index 39b67a886444fe1db46a54e4006d37abd68d447a..c76f81ef3a9c5a2a39743e1d222727eed94bfb7c 100644
--- a/src/scopes.cc
+++ b/src/scopes.cc
@@ -301,7 +301,7 @@ bool Scope::Analyze(CompilationInfo* info) {
}
-void Scope::Initialize() {
+void Scope::Initialize(bool uninitialized_this) {
DCHECK(!already_resolved());
// Add this scope as a new inner scope of the outer scope.
@@ -321,13 +321,12 @@ void Scope::Initialize() {
// such parameter is 'this' which is passed on the stack when
// invoking scripts
if (is_declaration_scope()) {
- Variable* var =
- variables_.Declare(this,
- ast_value_factory_->this_string(),
- VAR,
- false,
- Variable::THIS,
- kCreatedInitialized);
+ DCHECK(!uninitialized_this || is_function_scope());
+ DCHECK(FLAG_experimental_classes || !uninitialized_this);
+ Variable* var = variables_.Declare(
+ this, ast_value_factory_->this_string(),
+ uninitialized_this ? CONST : VAR, false, Variable::THIS,
+ uninitialized_this ? kNeedsInitialization : kCreatedInitialized);
var->AllocateTo(Variable::PARAMETER, -1);
receiver_ = var;
} else {

Powered by Google App Engine
This is Rietveld 408576698