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

Unified Diff: src/runtime/runtime-array.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/objects.cc ('k') | src/runtime/runtime-classes.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime/runtime-array.cc
diff --git a/src/runtime/runtime-array.cc b/src/runtime/runtime-array.cc
index 67eaa4b632b940af40c630318d67d171def95f67..c636331afd90779d5a908486cb474d745c3da8be 100644
--- a/src/runtime/runtime-array.cc
+++ b/src/runtime/runtime-array.cc
@@ -235,7 +235,7 @@ RUNTIME_FUNCTION(Runtime_GetArrayKeys) {
static Object* ArrayConstructorCommon(Isolate* isolate,
Handle<JSFunction> constructor,
- Handle<JSFunction> original_constructor,
+ Handle<JSFunction> new_target,
Handle<AllocationSite> site,
Arguments* caller_args) {
Factory* factory = isolate->factory();
@@ -317,10 +317,9 @@ static Object* ArrayConstructorCommon(Isolate* isolate,
// Set up the prototoype using original function.
// TODO(dslomov): instead of setting the __proto__,
// use and cache the correct map.
- if (*original_constructor != *constructor) {
- if (original_constructor->has_instance_prototype()) {
- Handle<Object> prototype =
- handle(original_constructor->instance_prototype(), isolate);
+ if (*new_target != *constructor) {
+ if (new_target->has_instance_prototype()) {
+ Handle<Object> prototype(new_target->instance_prototype(), isolate);
MAYBE_RETURN(JSObject::SetPrototype(array, prototype, false,
Object::THROW_ON_ERROR),
isolate->heap()->exception());
@@ -377,9 +376,9 @@ RUNTIME_FUNCTION(Runtime_ArrayConstructorWithSubclassing) {
CHECK(last_arg_index >= 0);
CONVERT_ARG_HANDLE_CHECKED(JSFunction, constructor, pre_last_arg_index);
- CONVERT_ARG_HANDLE_CHECKED(JSFunction, original_constructor, last_arg_index);
+ CONVERT_ARG_HANDLE_CHECKED(JSFunction, new_target, last_arg_index);
Arguments caller_args(args_length - 2, args.arguments());
- return ArrayConstructorCommon(isolate, constructor, original_constructor,
+ return ArrayConstructorCommon(isolate, constructor, new_target,
Handle<AllocationSite>::null(), &caller_args);
}
« no previous file with comments | « src/objects.cc ('k') | src/runtime/runtime-classes.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698