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

Unified Diff: src/runtime/runtime-function.cc

Issue 1442643009: Rename original constructor to new target (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rebase Created 5 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
« no previous file with comments | « src/runtime/runtime-classes.cc ('k') | src/runtime/runtime-object.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime/runtime-function.cc
diff --git a/src/runtime/runtime-function.cc b/src/runtime/runtime-function.cc
index 41ddff20b7a64a761f906e4f9ae63ae36b5d2e1a..77428eeb892af6b0d84599488207279343152d10 100644
--- a/src/runtime/runtime-function.cc
+++ b/src/runtime/runtime-function.cc
@@ -52,7 +52,7 @@ RUNTIME_FUNCTION(Runtime_CompleteFunctionConstruction) {
DCHECK(args.length() == 3);
CONVERT_ARG_HANDLE_CHECKED(JSFunction, func, 0);
CONVERT_ARG_HANDLE_CHECKED(JSFunction, constructor, 1);
- CONVERT_ARG_HANDLE_CHECKED(Object, new_target, 2);
+ CONVERT_ARG_HANDLE_CHECKED(Object, unchecked_new_target, 2);
func->shared()->set_name_should_print_as_anonymous(true);
// If new.target is equal to |constructor| then the function |func| created
@@ -61,18 +61,19 @@ RUNTIME_FUNCTION(Runtime_CompleteFunctionConstruction) {
// Function builtin subclassing case and therefore the function |func|
// has wrong initial map. To fix that we create a new function object with
// correct initial map.
- if (new_target->IsUndefined() || *constructor == *new_target) {
+ if (unchecked_new_target->IsUndefined() ||
+ *constructor == *unchecked_new_target) {
return *func;
}
// Create a new JSFunction object with correct initial map.
HandleScope handle_scope(isolate);
- Handle<JSFunction> original_constructor =
- Handle<JSFunction>::cast(new_target);
+ Handle<JSFunction> new_target =
+ Handle<JSFunction>::cast(unchecked_new_target);
DCHECK(constructor->has_initial_map());
Handle<Map> initial_map =
- JSFunction::EnsureDerivedHasInitialMap(original_constructor, constructor);
+ JSFunction::EnsureDerivedHasInitialMap(new_target, constructor);
Handle<SharedFunctionInfo> shared_info(func->shared(), isolate);
Handle<Context> context(func->context(), isolate);
« no previous file with comments | « src/runtime/runtime-classes.cc ('k') | src/runtime/runtime-object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698