| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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/builtins.h" | 5 #include "src/builtins.h" |
| 6 | 6 |
| 7 #include "src/api.h" | 7 #include "src/api.h" |
| 8 #include "src/api-natives.h" | 8 #include "src/api-natives.h" |
| 9 #include "src/arguments.h" | 9 #include "src/arguments.h" |
| 10 #include "src/base/once.h" | 10 #include "src/base/once.h" |
| (...skipping 1811 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1822 return *result; | 1822 return *result; |
| 1823 } | 1823 } |
| 1824 | 1824 |
| 1825 | 1825 |
| 1826 namespace { | 1826 namespace { |
| 1827 | 1827 |
| 1828 // ES6 section 9.5.15 ProxyCreate (target, handler) | 1828 // ES6 section 9.5.15 ProxyCreate (target, handler) |
| 1829 MaybeHandle<JSProxy> ProxyCreate(Isolate* isolate, Handle<Object> target, | 1829 MaybeHandle<JSProxy> ProxyCreate(Isolate* isolate, Handle<Object> target, |
| 1830 Handle<Object> handler) { | 1830 Handle<Object> handler) { |
| 1831 if (!target->IsJSReceiver()) { | 1831 if (!target->IsJSReceiver()) { |
| 1832 THROW_NEW_ERROR( | 1832 THROW_NEW_ERROR(isolate, NewTypeError(MessageTemplate::kProxyNonObject), |
| 1833 isolate, NewTypeError(MessageTemplate::kProxyTargetNonObject), JSProxy); | 1833 JSProxy); |
| 1834 } | 1834 } |
| 1835 if (target->IsJSProxy() && JSProxy::cast(*target)->IsRevoked()) { | 1835 if (target->IsJSProxy() && JSProxy::cast(*target)->IsRevoked()) { |
| 1836 THROW_NEW_ERROR(isolate, | 1836 THROW_NEW_ERROR(isolate, |
| 1837 NewTypeError(MessageTemplate::kProxyHandlerOrTargetRevoked), | 1837 NewTypeError(MessageTemplate::kProxyHandlerOrTargetRevoked), |
| 1838 JSProxy); | 1838 JSProxy); |
| 1839 } | 1839 } |
| 1840 if (!handler->IsJSReceiver()) { | 1840 if (!handler->IsJSReceiver()) { |
| 1841 THROW_NEW_ERROR(isolate, | 1841 THROW_NEW_ERROR(isolate, NewTypeError(MessageTemplate::kProxyNonObject), |
| 1842 NewTypeError(MessageTemplate::kProxyHandlerNonObject), | |
| 1843 JSProxy); | 1842 JSProxy); |
| 1844 } | 1843 } |
| 1845 if (handler->IsJSProxy() && JSProxy::cast(*handler)->IsRevoked()) { | 1844 if (handler->IsJSProxy() && JSProxy::cast(*handler)->IsRevoked()) { |
| 1846 THROW_NEW_ERROR(isolate, | 1845 THROW_NEW_ERROR(isolate, |
| 1847 NewTypeError(MessageTemplate::kProxyHandlerOrTargetRevoked), | 1846 NewTypeError(MessageTemplate::kProxyHandlerOrTargetRevoked), |
| 1848 JSProxy); | 1847 JSProxy); |
| 1849 } | 1848 } |
| 1850 return isolate->factory()->NewJSProxy(Handle<JSReceiver>::cast(target), | 1849 return isolate->factory()->NewJSProxy(Handle<JSReceiver>::cast(target), |
| 1851 Handle<JSReceiver>::cast(handler)); | 1850 Handle<JSReceiver>::cast(handler)); |
| 1852 } | 1851 } |
| (...skipping 662 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2515 BUILTIN_LIST_C(DEFINE_BUILTIN_ACCESSOR_C) | 2514 BUILTIN_LIST_C(DEFINE_BUILTIN_ACCESSOR_C) |
| 2516 BUILTIN_LIST_A(DEFINE_BUILTIN_ACCESSOR_A) | 2515 BUILTIN_LIST_A(DEFINE_BUILTIN_ACCESSOR_A) |
| 2517 BUILTIN_LIST_H(DEFINE_BUILTIN_ACCESSOR_H) | 2516 BUILTIN_LIST_H(DEFINE_BUILTIN_ACCESSOR_H) |
| 2518 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A) | 2517 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A) |
| 2519 #undef DEFINE_BUILTIN_ACCESSOR_C | 2518 #undef DEFINE_BUILTIN_ACCESSOR_C |
| 2520 #undef DEFINE_BUILTIN_ACCESSOR_A | 2519 #undef DEFINE_BUILTIN_ACCESSOR_A |
| 2521 | 2520 |
| 2522 | 2521 |
| 2523 } // namespace internal | 2522 } // namespace internal |
| 2524 } // namespace v8 | 2523 } // namespace v8 |
| OLD | NEW |