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

Unified Diff: src/full-codegen.cc

Issue 923443003: new classes: no longer experimental. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: One more rebase? Created 5 years, 10 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/full-codegen.h ('k') | src/ia32/builtins-ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/full-codegen.cc
diff --git a/src/full-codegen.cc b/src/full-codegen.cc
index 44a04ef2a5d93eb7ca10f0bbc7a74f96625180a4..349626b0e08181dcf90781cbc91c51464a384f94 100644
--- a/src/full-codegen.cc
+++ b/src/full-codegen.cc
@@ -863,6 +863,22 @@ void FullCodeGenerator::VisitSuperReference(SuperReference* super) {
}
+bool FullCodeGenerator::ValidateSuperCall(Call* expr) {
+ Variable* new_target_var = scope()->DeclarationScope()->new_target_var();
+ if (new_target_var == nullptr) {
+ // TODO(dslomov): this is not exactly correct, the spec requires us
+ // to execute the constructor and only fail when an assigment to 'this'
+ // is attempted. Will implement once we have general new.target support,
+ // but also filed spec bug 3843 to make it an early error.
+ __ CallRuntime(Runtime::kThrowUnsupportedSuperError, 0);
+ RecordJSReturnSite(expr);
+ context()->Plug(result_register());
+ return false;
+ }
+ return true;
+}
+
+
void FullCodeGenerator::SetExpressionPosition(Expression* expr) {
if (!info_->is_debug()) {
CodeGenerator::RecordPositions(masm_, expr->position());
« no previous file with comments | « src/full-codegen.h ('k') | src/ia32/builtins-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698