| 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/elements.h" | 8 #include "src/elements.h" |
| 9 #include "src/factory.h" | 9 #include "src/factory.h" |
| 10 #include "src/isolate-inl.h" | 10 #include "src/isolate-inl.h" |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 // 8. Let newObj be ? Call(trap, handler, «target, argArray, newTarget »). | 127 // 8. Let newObj be ? Call(trap, handler, «target, argArray, newTarget »). |
| 128 Handle<Object> new_object; | 128 Handle<Object> new_object; |
| 129 Handle<Object> trap_args[] = {target, arg_array, new_target}; | 129 Handle<Object> trap_args[] = {target, arg_array, new_target}; |
| 130 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( | 130 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( |
| 131 isolate, new_object, | 131 isolate, new_object, |
| 132 Execution::Call(isolate, trap, handler, arraysize(trap_args), trap_args)); | 132 Execution::Call(isolate, trap, handler, arraysize(trap_args), trap_args)); |
| 133 // 9. If Type(newObj) is not Object, throw a TypeError exception. | 133 // 9. If Type(newObj) is not Object, throw a TypeError exception. |
| 134 if (!new_object->IsJSReceiver()) { | 134 if (!new_object->IsJSReceiver()) { |
| 135 THROW_NEW_ERROR_RETURN_FAILURE( | 135 THROW_NEW_ERROR_RETURN_FAILURE( |
| 136 isolate, | 136 isolate, |
| 137 NewTypeError(MessageTemplate::kProxyTrapConstructMustReturnObject, | 137 NewTypeError(MessageTemplate::kProxyConstructNonObject, new_object)); |
| 138 new_object)); | |
| 139 } | 138 } |
| 140 // 10. Return newObj. | 139 // 10. Return newObj. |
| 141 return *new_object; | 140 return *new_object; |
| 142 } | 141 } |
| 143 | 142 |
| 144 | 143 |
| 145 RUNTIME_FUNCTION(Runtime_IsJSProxy) { | 144 RUNTIME_FUNCTION(Runtime_IsJSProxy) { |
| 146 SealHandleScope shs(isolate); | 145 SealHandleScope shs(isolate); |
| 147 DCHECK(args.length() == 1); | 146 DCHECK(args.length() == 1); |
| 148 CONVERT_ARG_CHECKED(Object, obj, 0); | 147 CONVERT_ARG_CHECKED(Object, obj, 0); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 161 RUNTIME_FUNCTION(Runtime_RevokeProxy) { | 160 RUNTIME_FUNCTION(Runtime_RevokeProxy) { |
| 162 HandleScope scope(isolate); | 161 HandleScope scope(isolate); |
| 163 DCHECK(args.length() == 1); | 162 DCHECK(args.length() == 1); |
| 164 CONVERT_ARG_HANDLE_CHECKED(JSProxy, proxy, 0); | 163 CONVERT_ARG_HANDLE_CHECKED(JSProxy, proxy, 0); |
| 165 JSProxy::Revoke(proxy); | 164 JSProxy::Revoke(proxy); |
| 166 return isolate->heap()->undefined_value(); | 165 return isolate->heap()->undefined_value(); |
| 167 } | 166 } |
| 168 | 167 |
| 169 } // namespace internal | 168 } // namespace internal |
| 170 } // namespace v8 | 169 } // namespace v8 |
| OLD | NEW |