| 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 1622 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1633 */ | 1633 */ |
| 1634 | 1634 |
| 1635 if (target->IsJSObject()) { | 1635 if (target->IsJSObject()) { |
| 1636 return *isolate->factory()->ToBoolean( | 1636 return *isolate->factory()->ToBoolean( |
| 1637 JSObject::IsExtensible(Handle<JSObject>::cast(target))); | 1637 JSObject::IsExtensible(Handle<JSObject>::cast(target))); |
| 1638 } | 1638 } |
| 1639 return *isolate->factory()->false_value(); | 1639 return *isolate->factory()->false_value(); |
| 1640 } | 1640 } |
| 1641 | 1641 |
| 1642 | 1642 |
| 1643 // ES6 section 26.1.11 Reflect.ownKeys |
| 1644 BUILTIN(ReflectOwnKeys) { |
| 1645 HandleScope scope(isolate); |
| 1646 DCHECK_EQ(2, args.length()); |
| 1647 Handle<Object> target = args.at<Object>(1); |
| 1648 |
| 1649 if (!target->IsJSReceiver()) { |
| 1650 THROW_NEW_ERROR_RETURN_FAILURE( |
| 1651 isolate, NewTypeError(MessageTemplate::kCalledOnNonObject, |
| 1652 isolate->factory()->NewStringFromAsciiChecked( |
| 1653 "Reflect.ownKeys"))); |
| 1654 } |
| 1655 |
| 1656 Handle<FixedArray> keys; |
| 1657 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( |
| 1658 isolate, keys, JSReceiver::GetKeys(Handle<JSReceiver>::cast(target), |
| 1659 JSReceiver::OWN_ONLY, INCLUDE_SYMBOLS, |
| 1660 CONVERT_TO_STRING, false)); |
| 1661 return *isolate->factory()->NewJSArrayWithElements(keys); |
| 1662 } |
| 1663 |
| 1664 |
| 1643 // ES6 section 26.1.12 Reflect.preventExtensions | 1665 // ES6 section 26.1.12 Reflect.preventExtensions |
| 1644 BUILTIN(ReflectPreventExtensions) { | 1666 BUILTIN(ReflectPreventExtensions) { |
| 1645 HandleScope scope(isolate); | 1667 HandleScope scope(isolate); |
| 1646 DCHECK_EQ(2, args.length()); | 1668 DCHECK_EQ(2, args.length()); |
| 1647 Handle<Object> target = args.at<Object>(1); | 1669 Handle<Object> target = args.at<Object>(1); |
| 1648 | 1670 |
| 1649 if (!target->IsJSReceiver()) { | 1671 if (!target->IsJSReceiver()) { |
| 1650 THROW_NEW_ERROR_RETURN_FAILURE( | 1672 THROW_NEW_ERROR_RETURN_FAILURE( |
| 1651 isolate, NewTypeError(MessageTemplate::kCalledOnNonObject, | 1673 isolate, NewTypeError(MessageTemplate::kCalledOnNonObject, |
| 1652 isolate->factory()->NewStringFromAsciiChecked( | 1674 isolate->factory()->NewStringFromAsciiChecked( |
| (...skipping 710 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2363 BUILTIN_LIST_C(DEFINE_BUILTIN_ACCESSOR_C) | 2385 BUILTIN_LIST_C(DEFINE_BUILTIN_ACCESSOR_C) |
| 2364 BUILTIN_LIST_A(DEFINE_BUILTIN_ACCESSOR_A) | 2386 BUILTIN_LIST_A(DEFINE_BUILTIN_ACCESSOR_A) |
| 2365 BUILTIN_LIST_H(DEFINE_BUILTIN_ACCESSOR_H) | 2387 BUILTIN_LIST_H(DEFINE_BUILTIN_ACCESSOR_H) |
| 2366 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A) | 2388 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A) |
| 2367 #undef DEFINE_BUILTIN_ACCESSOR_C | 2389 #undef DEFINE_BUILTIN_ACCESSOR_C |
| 2368 #undef DEFINE_BUILTIN_ACCESSOR_A | 2390 #undef DEFINE_BUILTIN_ACCESSOR_A |
| 2369 | 2391 |
| 2370 | 2392 |
| 2371 } // namespace internal | 2393 } // namespace internal |
| 2372 } // namespace v8 | 2394 } // namespace v8 |
| OLD | NEW |