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

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: CHECK_OK fixed 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
« no previous file with comments | « src/scopes.h ('k') | src/x64/builtins-x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/scopes.cc
diff --git a/src/scopes.cc b/src/scopes.cc
index 80bf82b6b60277627ece3d20b51e1f35da774d78..15534314632ec1d5f70dafdfab2436e0d325f6de 100644
--- a/src/scopes.cc
+++ b/src/scopes.cc
@@ -291,7 +291,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.
@@ -311,13 +311,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 {
« no previous file with comments | « src/scopes.h ('k') | src/x64/builtins-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698