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

Side by Side Diff: src/runtime/runtime-classes.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 unified diff | Download patch
« no previous file with comments | « src/runtime/runtime-array.cc ('k') | src/runtime/runtime-function.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/runtime/runtime-utils.h" 5 #include "src/runtime/runtime-utils.h"
6 6
7 #include <stdlib.h> 7 #include <stdlib.h>
8 #include <limits> 8 #include <limits>
9 9
10 #include "src/arguments.h" 10 #include "src/arguments.h"
(...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after
489 Debug* debug = isolate->debug(); 489 Debug* debug = isolate->debug();
490 // Handle stepping into constructors if step into is active. 490 // Handle stepping into constructors if step into is active.
491 if (debug->StepInActive()) debug->HandleStepIn(function, true); 491 if (debug->StepInActive()) debug->HandleStepIn(function, true);
492 return *isolate->factory()->undefined_value(); 492 return *isolate->factory()->undefined_value();
493 } 493 }
494 494
495 495
496 RUNTIME_FUNCTION(Runtime_DefaultConstructorCallSuper) { 496 RUNTIME_FUNCTION(Runtime_DefaultConstructorCallSuper) {
497 HandleScope scope(isolate); 497 HandleScope scope(isolate);
498 DCHECK(args.length() == 2); 498 DCHECK(args.length() == 2);
499 CONVERT_ARG_HANDLE_CHECKED(JSFunction, original_constructor, 0); 499 CONVERT_ARG_HANDLE_CHECKED(JSFunction, new_target, 0);
500 CONVERT_ARG_HANDLE_CHECKED(JSFunction, super_constructor, 1); 500 CONVERT_ARG_HANDLE_CHECKED(JSFunction, super_constructor, 1);
501 JavaScriptFrameIterator it(isolate); 501 JavaScriptFrameIterator it(isolate);
502 502
503 // Determine the actual arguments passed to the function. 503 // Determine the actual arguments passed to the function.
504 int argument_count = 0; 504 int argument_count = 0;
505 base::SmartArrayPointer<Handle<Object>> arguments = 505 base::SmartArrayPointer<Handle<Object>> arguments =
506 Runtime::GetCallerArguments(isolate, 0, &argument_count); 506 Runtime::GetCallerArguments(isolate, 0, &argument_count);
507 507
508 Handle<Object> result; 508 Handle<Object> result;
509 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( 509 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
510 isolate, result, 510 isolate, result, Execution::New(isolate, super_constructor, new_target,
511 Execution::New(isolate, super_constructor, original_constructor, 511 argument_count, arguments.get()));
512 argument_count, arguments.get()));
513 512
514 return *result; 513 return *result;
515 } 514 }
516 515
517 } // namespace internal 516 } // namespace internal
518 } // namespace v8 517 } // namespace v8
OLDNEW
« no previous file with comments | « src/runtime/runtime-array.cc ('k') | src/runtime/runtime-function.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698