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 "src/arguments.h" | 7 #include "src/arguments.h" |
8 #include "src/factory.h" | 8 #include "src/factory.h" |
9 #include "src/objects-inl.h" | 9 #include "src/objects-inl.h" |
10 | 10 |
(...skipping 13 matching lines...) Expand all Loading... |
24 if (target->IsJSProxy() && !JSProxy::cast(*target)->has_handler()) { | 24 if (target->IsJSProxy() && !JSProxy::cast(*target)->has_handler()) { |
25 // TODO(cbruni): Use better error message. | 25 // TODO(cbruni): Use better error message. |
26 THROW_NEW_ERROR_RETURN_FAILURE( | 26 THROW_NEW_ERROR_RETURN_FAILURE( |
27 isolate, NewTypeError(MessageTemplate::kProxyTargetNonObject)); | 27 isolate, NewTypeError(MessageTemplate::kProxyTargetNonObject)); |
28 } | 28 } |
29 if (!handler->IsSpecObject()) { | 29 if (!handler->IsSpecObject()) { |
30 THROW_NEW_ERROR_RETURN_FAILURE( | 30 THROW_NEW_ERROR_RETURN_FAILURE( |
31 isolate, NewTypeError(MessageTemplate::kProxyHandlerNonObject)); | 31 isolate, NewTypeError(MessageTemplate::kProxyHandlerNonObject)); |
32 } | 32 } |
33 if (handler->IsJSProxy() && !JSProxy::cast(*handler)->has_handler()) { | 33 if (handler->IsJSProxy() && !JSProxy::cast(*handler)->has_handler()) { |
34 // TODO(cbruni): Use better error message. | 34 THROW_NEW_ERROR_RETURN_FAILURE(isolate, |
35 THROW_NEW_ERROR_RETURN_FAILURE( | 35 NewTypeError(MessageTemplate::kProtoNotSet)); |
36 isolate, NewTypeError(MessageTemplate::kProxyHandlerNonObject)); | |
37 } | 36 } |
38 instance->set_target(*target); | 37 instance->set_target(*target); |
39 instance->set_handler(*handler); | 38 instance->set_handler(*handler); |
40 instance->set_hash(isolate->heap()->undefined_value(), SKIP_WRITE_BARRIER); | 39 instance->set_hash(isolate->heap()->undefined_value(), SKIP_WRITE_BARRIER); |
41 return *instance; | 40 return *instance; |
42 } | 41 } |
43 | 42 |
44 | 43 |
45 RUNTIME_FUNCTION(Runtime_CreateJSFunctionProxy) { | 44 RUNTIME_FUNCTION(Runtime_CreateJSFunctionProxy) { |
46 HandleScope scope(isolate); | 45 HandleScope scope(isolate); |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 | 90 |
92 RUNTIME_FUNCTION(Runtime_GetConstructTrap) { | 91 RUNTIME_FUNCTION(Runtime_GetConstructTrap) { |
93 SealHandleScope shs(isolate); | 92 SealHandleScope shs(isolate); |
94 DCHECK(args.length() == 1); | 93 DCHECK(args.length() == 1); |
95 CONVERT_ARG_CHECKED(JSFunctionProxy, proxy, 0); | 94 CONVERT_ARG_CHECKED(JSFunctionProxy, proxy, 0); |
96 return proxy->construct_trap(); | 95 return proxy->construct_trap(); |
97 } | 96 } |
98 | 97 |
99 } // namespace internal | 98 } // namespace internal |
100 } // namespace v8 | 99 } // namespace v8 |
OLD | NEW |