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 1736 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1747 HandleScope scope(isolate); | 1747 HandleScope scope(isolate); |
1748 // The ConstructStub is executed in the context of the caller, so we need | 1748 // The ConstructStub is executed in the context of the caller, so we need |
1749 // to enter the callee context first before raising an exception. | 1749 // to enter the callee context first before raising an exception. |
1750 isolate->set_context(args.target()->context()); | 1750 isolate->set_context(args.target()->context()); |
1751 THROW_NEW_ERROR_RETURN_FAILURE( | 1751 THROW_NEW_ERROR_RETURN_FAILURE( |
1752 isolate, NewTypeError(MessageTemplate::kNotConstructor, | 1752 isolate, NewTypeError(MessageTemplate::kNotConstructor, |
1753 isolate->factory()->Symbol_string())); | 1753 isolate->factory()->Symbol_string())); |
1754 } | 1754 } |
1755 | 1755 |
1756 | 1756 |
| 1757 // ES6 19.1.3.6 Object.prototype.toString |
| 1758 BUILTIN(ObjectProtoToString) { |
| 1759 HandleScope scope(isolate); |
| 1760 Handle<Object> object = args.at<Object>(0); |
| 1761 Handle<String> result; |
| 1762 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( |
| 1763 isolate, result, JSObject::ObjectProtoToString(isolate, object)); |
| 1764 return *result; |
| 1765 } |
| 1766 |
| 1767 |
1757 namespace { | 1768 namespace { |
1758 | 1769 |
1759 // ES6 section 9.5.15 ProxyCreate (target, handler) | 1770 // ES6 section 9.5.15 ProxyCreate (target, handler) |
1760 MaybeHandle<JSProxy> ProxyCreate(Isolate* isolate, Handle<Object> target, | 1771 MaybeHandle<JSProxy> ProxyCreate(Isolate* isolate, Handle<Object> target, |
1761 Handle<Object> handler) { | 1772 Handle<Object> handler) { |
1762 if (!target->IsJSReceiver()) { | 1773 if (!target->IsJSReceiver()) { |
1763 THROW_NEW_ERROR( | 1774 THROW_NEW_ERROR( |
1764 isolate, NewTypeError(MessageTemplate::kProxyTargetNonObject), JSProxy); | 1775 isolate, NewTypeError(MessageTemplate::kProxyTargetNonObject), JSProxy); |
1765 } | 1776 } |
1766 if (target->IsJSProxy() && JSProxy::cast(*target)->IsRevoked()) { | 1777 if (target->IsJSProxy() && JSProxy::cast(*target)->IsRevoked()) { |
(...skipping 668 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2435 BUILTIN_LIST_C(DEFINE_BUILTIN_ACCESSOR_C) | 2446 BUILTIN_LIST_C(DEFINE_BUILTIN_ACCESSOR_C) |
2436 BUILTIN_LIST_A(DEFINE_BUILTIN_ACCESSOR_A) | 2447 BUILTIN_LIST_A(DEFINE_BUILTIN_ACCESSOR_A) |
2437 BUILTIN_LIST_H(DEFINE_BUILTIN_ACCESSOR_H) | 2448 BUILTIN_LIST_H(DEFINE_BUILTIN_ACCESSOR_H) |
2438 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A) | 2449 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A) |
2439 #undef DEFINE_BUILTIN_ACCESSOR_C | 2450 #undef DEFINE_BUILTIN_ACCESSOR_C |
2440 #undef DEFINE_BUILTIN_ACCESSOR_A | 2451 #undef DEFINE_BUILTIN_ACCESSOR_A |
2441 | 2452 |
2442 | 2453 |
2443 } // namespace internal | 2454 } // namespace internal |
2444 } // namespace v8 | 2455 } // namespace v8 |
OLD | NEW |