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

Unified Diff: src/js/v8natives.js

Issue 1428823002: [es6] Fix Function and GeneratorFunction built-ins subclassing. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@subclass
Patch Set: Test updated Created 5 years, 2 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/js/v8natives.js
diff --git a/src/js/v8natives.js b/src/js/v8natives.js
index 3c1e175a9e7f4f1bd8b23678b85c6722ea1d9f9a..dae087ded436e361b2610e8d99c634d6aace27a2 100644
--- a/src/js/v8natives.js
+++ b/src/js/v8natives.js
@@ -1797,9 +1797,10 @@ function FunctionConstructor(arg1) { // length == 1
var global_proxy = %GlobalProxy(FunctionConstructor);
// Compile the string in the constructor and not a helper so that errors
// appear to come from here.
- var f = %_CallFunction(global_proxy, %CompileString(source, true));
- %FunctionMarkNameShouldPrintAsAnonymous(f);
- return f;
+ var func = %_CallFunction(global_proxy, %CompileString(source, true));
+ // Set name-should-print-as-anonymous flag on the SFI and ensure that
Toon Verwaest 2015/10/30 10:58:01 write out sfi
Igor Sheludko 2015/10/30 11:08:57 Done.
+ // |func| uses correct initial map from |new.target| if it's available.
+ return %CompleteFunctionConstruction(func, GlobalFunction, new.target);
}

Powered by Google App Engine
This is Rietveld 408576698