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 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 isolate, | 128 isolate, |
129 NewTypeError(MessageTemplate::kProxyConstructNonObject, new_object)); | 129 NewTypeError(MessageTemplate::kProxyConstructNonObject, new_object)); |
130 } | 130 } |
131 // 10. Return newObj. | 131 // 10. Return newObj. |
132 return *new_object; | 132 return *new_object; |
133 } | 133 } |
134 | 134 |
135 | 135 |
136 RUNTIME_FUNCTION(Runtime_IsJSProxy) { | 136 RUNTIME_FUNCTION(Runtime_IsJSProxy) { |
137 SealHandleScope shs(isolate); | 137 SealHandleScope shs(isolate); |
138 DCHECK(args.length() == 1); | 138 DCHECK_EQ(1, args.length()); |
139 CONVERT_ARG_CHECKED(Object, obj, 0); | 139 CONVERT_ARG_CHECKED(Object, obj, 0); |
140 return isolate->heap()->ToBoolean(obj->IsJSProxy()); | 140 return isolate->heap()->ToBoolean(obj->IsJSProxy()); |
141 } | 141 } |
142 | 142 |
143 | 143 |
144 RUNTIME_FUNCTION(Runtime_JSProxyGetHandler) { | 144 RUNTIME_FUNCTION(Runtime_JSProxyGetHandler) { |
145 SealHandleScope shs(isolate); | 145 SealHandleScope shs(isolate); |
146 DCHECK(args.length() == 1); | 146 DCHECK_EQ(1, args.length()); |
147 CONVERT_ARG_CHECKED(JSProxy, proxy, 0); | 147 CONVERT_ARG_CHECKED(JSProxy, proxy, 0); |
148 return proxy->handler(); | 148 return proxy->handler(); |
149 } | 149 } |
150 | 150 |
151 | 151 |
152 RUNTIME_FUNCTION(Runtime_JSProxyGetTarget) { | 152 RUNTIME_FUNCTION(Runtime_JSProxyGetTarget) { |
153 SealHandleScope shs(isolate); | 153 SealHandleScope shs(isolate); |
154 DCHECK(args.length() == 1); | 154 DCHECK_EQ(1, args.length()); |
155 CONVERT_ARG_CHECKED(JSProxy, proxy, 0); | 155 CONVERT_ARG_CHECKED(JSProxy, proxy, 0); |
156 return proxy->target(); | 156 return proxy->target(); |
157 } | 157 } |
158 | 158 |
159 | 159 |
160 RUNTIME_FUNCTION(Runtime_JSProxyRevoke) { | 160 RUNTIME_FUNCTION(Runtime_JSProxyRevoke) { |
161 HandleScope scope(isolate); | 161 HandleScope scope(isolate); |
162 DCHECK(args.length() == 1); | 162 DCHECK_EQ(1, args.length()); |
163 CONVERT_ARG_HANDLE_CHECKED(JSProxy, proxy, 0); | 163 CONVERT_ARG_HANDLE_CHECKED(JSProxy, proxy, 0); |
164 JSProxy::Revoke(proxy); | 164 JSProxy::Revoke(proxy); |
165 return isolate->heap()->undefined_value(); | 165 return isolate->heap()->undefined_value(); |
166 } | 166 } |
167 | 167 |
168 } // namespace internal | 168 } // namespace internal |
169 } // namespace v8 | 169 } // namespace v8 |
OLD | NEW |