Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "src/arguments.h" | 9 #include "src/arguments.h" |
| 10 #include "src/ast/prettyprinter.h" | 10 #include "src/ast/prettyprinter.h" |
| (...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 359 if (str->length() > 0) return str; | 359 if (str->length() > 0) return str; |
| 360 } else { | 360 } else { |
| 361 isolate->clear_pending_exception(); | 361 isolate->clear_pending_exception(); |
| 362 } | 362 } |
| 363 } | 363 } |
| 364 return Object::TypeOf(isolate, object); | 364 return Object::TypeOf(isolate, object); |
| 365 } | 365 } |
| 366 | 366 |
| 367 } // namespace | 367 } // namespace |
| 368 | 368 |
| 369 RUNTIME_FUNCTION(Runtime_NotConstructor) { | |
|
Benedikt Meurer
2017/02/14 04:07:49
Please rename this to ThrowNotConstructor.
vabr (Chromium)
2017/02/14 10:48:20
Done.
| |
| 370 HandleScope scope(isolate); | |
| 371 DCHECK_EQ(1, args.length()); | |
| 372 CONVERT_ARG_HANDLE_CHECKED(Object, object, 0); | |
| 373 THROW_NEW_ERROR_RETURN_FAILURE( | |
| 374 isolate, NewTypeError(MessageTemplate::kNotConstructor, object)); | |
| 375 } | |
| 369 | 376 |
| 370 RUNTIME_FUNCTION(Runtime_ThrowCalledNonCallable) { | 377 RUNTIME_FUNCTION(Runtime_ThrowCalledNonCallable) { |
| 371 HandleScope scope(isolate); | 378 HandleScope scope(isolate); |
| 372 DCHECK_EQ(1, args.length()); | 379 DCHECK_EQ(1, args.length()); |
| 373 CONVERT_ARG_HANDLE_CHECKED(Object, object, 0); | 380 CONVERT_ARG_HANDLE_CHECKED(Object, object, 0); |
| 374 Handle<String> callsite = RenderCallSite(isolate, object); | 381 Handle<String> callsite = RenderCallSite(isolate, object); |
| 375 THROW_NEW_ERROR_RETURN_FAILURE( | 382 THROW_NEW_ERROR_RETURN_FAILURE( |
| 376 isolate, NewTypeError(MessageTemplate::kCalledNonCallable, callsite)); | 383 isolate, NewTypeError(MessageTemplate::kCalledNonCallable, callsite)); |
| 377 } | 384 } |
| 378 | 385 |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 492 HandleScope scope(isolate); | 499 HandleScope scope(isolate); |
| 493 DCHECK_EQ(1, args.length()); | 500 DCHECK_EQ(1, args.length()); |
| 494 CONVERT_ARG_HANDLE_CHECKED(JSFunction, target, 0); | 501 CONVERT_ARG_HANDLE_CHECKED(JSFunction, target, 0); |
| 495 Handle<JSObject> global_proxy(target->global_proxy(), isolate); | 502 Handle<JSObject> global_proxy(target->global_proxy(), isolate); |
| 496 return *isolate->factory()->ToBoolean( | 503 return *isolate->factory()->ToBoolean( |
| 497 Builtins::AllowDynamicFunction(isolate, target, global_proxy)); | 504 Builtins::AllowDynamicFunction(isolate, target, global_proxy)); |
| 498 } | 505 } |
| 499 | 506 |
| 500 } // namespace internal | 507 } // namespace internal |
| 501 } // namespace v8 | 508 } // namespace v8 |
| OLD | NEW |