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

Side by Side Diff: src/runtime/runtime-internal.cc

Issue 1593553002: [runtime] Throw exception for derived constructors in correct context. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: disable regression test for ignition Created 4 years, 11 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 unified diff | Download patch
« no previous file with comments | « src/runtime/runtime-classes.cc ('k') | src/x64/builtins-x64.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 "src/arguments.h" 7 #include "src/arguments.h"
8 #include "src/ast/prettyprinter.h" 8 #include "src/ast/prettyprinter.h"
9 #include "src/bootstrapper.h" 9 #include "src/bootstrapper.h"
10 #include "src/conversions.h" 10 #include "src/conversions.h"
(...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after
441 RUNTIME_FUNCTION(Runtime_ThrowConstructedNonConstructable) { 441 RUNTIME_FUNCTION(Runtime_ThrowConstructedNonConstructable) {
442 HandleScope scope(isolate); 442 HandleScope scope(isolate);
443 DCHECK_EQ(1, args.length()); 443 DCHECK_EQ(1, args.length());
444 CONVERT_ARG_HANDLE_CHECKED(Object, object, 0); 444 CONVERT_ARG_HANDLE_CHECKED(Object, object, 0);
445 Handle<String> callsite = RenderCallSite(isolate, object); 445 Handle<String> callsite = RenderCallSite(isolate, object);
446 THROW_NEW_ERROR_RETURN_FAILURE( 446 THROW_NEW_ERROR_RETURN_FAILURE(
447 isolate, NewTypeError(MessageTemplate::kNotConstructor, callsite)); 447 isolate, NewTypeError(MessageTemplate::kNotConstructor, callsite));
448 } 448 }
449 449
450 450
451 RUNTIME_FUNCTION(Runtime_ThrowDerivedConstructorReturnedNonObject) {
452 HandleScope scope(isolate);
453 DCHECK_EQ(0, args.length());
454 THROW_NEW_ERROR_RETURN_FAILURE(
455 isolate, NewTypeError(MessageTemplate::kDerivedConstructorReturn));
456 }
457
458
451 // ES6 section 7.3.17 CreateListFromArrayLike (obj) 459 // ES6 section 7.3.17 CreateListFromArrayLike (obj)
452 RUNTIME_FUNCTION(Runtime_CreateListFromArrayLike) { 460 RUNTIME_FUNCTION(Runtime_CreateListFromArrayLike) {
453 HandleScope scope(isolate); 461 HandleScope scope(isolate);
454 DCHECK_EQ(1, args.length()); 462 DCHECK_EQ(1, args.length());
455 CONVERT_ARG_HANDLE_CHECKED(Object, object, 0); 463 CONVERT_ARG_HANDLE_CHECKED(Object, object, 0);
456 Handle<FixedArray> result; 464 Handle<FixedArray> result;
457 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( 465 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
458 isolate, result, 466 isolate, result,
459 Object::CreateListFromArrayLike(isolate, object, ElementTypes::kAll)); 467 Object::CreateListFromArrayLike(isolate, object, ElementTypes::kAll));
460 return *result; 468 return *result;
461 } 469 }
462 470
463 471
464 RUNTIME_FUNCTION(Runtime_IncrementUseCounter) { 472 RUNTIME_FUNCTION(Runtime_IncrementUseCounter) {
465 HandleScope scope(isolate); 473 HandleScope scope(isolate);
466 DCHECK_EQ(1, args.length()); 474 DCHECK_EQ(1, args.length());
467 CONVERT_SMI_ARG_CHECKED(counter, 0); 475 CONVERT_SMI_ARG_CHECKED(counter, 0);
468 isolate->CountUsage(static_cast<v8::Isolate::UseCounterFeature>(counter)); 476 isolate->CountUsage(static_cast<v8::Isolate::UseCounterFeature>(counter));
469 return isolate->heap()->undefined_value(); 477 return isolate->heap()->undefined_value();
470 } 478 }
471 479
472 } // namespace internal 480 } // namespace internal
473 } // namespace v8 481 } // namespace v8
OLDNEW
« no previous file with comments | « src/runtime/runtime-classes.cc ('k') | src/x64/builtins-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698