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 1785 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1796 return GetOwnPropertyKeys(isolate, args, SKIP_SYMBOLS); | 1796 return GetOwnPropertyKeys(isolate, args, SKIP_SYMBOLS); |
1797 } | 1797 } |
1798 | 1798 |
1799 | 1799 |
1800 // ES6 section 19.1.2.8 Object.getOwnPropertySymbols ( O ) | 1800 // ES6 section 19.1.2.8 Object.getOwnPropertySymbols ( O ) |
1801 BUILTIN(ObjectGetOwnPropertySymbols) { | 1801 BUILTIN(ObjectGetOwnPropertySymbols) { |
1802 return GetOwnPropertyKeys(isolate, args, SKIP_STRINGS); | 1802 return GetOwnPropertyKeys(isolate, args, SKIP_STRINGS); |
1803 } | 1803 } |
1804 | 1804 |
1805 | 1805 |
1806 // ES#sec-object.is Object.is ( value1, value2 ) | |
1807 BUILTIN(ObjectIs) { | |
1808 SealHandleScope shs(isolate); | |
1809 DCHECK_EQ(3, args.length()); | |
1810 Object* value1 = args[1]; | |
Michael Starzinger
2016/02/17 09:44:21
nit: Even with the sealed handle scope, we should
Benedikt Meurer
2016/02/17 10:20:26
Done.
| |
1811 Object* value2 = args[2]; | |
1812 return isolate->heap()->ToBoolean(value1->SameValue(value2)); | |
1813 } | |
1814 | |
1815 | |
1806 // ES6 section 19.1.2.11 Object.isExtensible ( O ) | 1816 // ES6 section 19.1.2.11 Object.isExtensible ( O ) |
1807 BUILTIN(ObjectIsExtensible) { | 1817 BUILTIN(ObjectIsExtensible) { |
1808 HandleScope scope(isolate); | 1818 HandleScope scope(isolate); |
1809 Handle<Object> object = args.atOrUndefined(isolate, 1); | 1819 Handle<Object> object = args.atOrUndefined(isolate, 1); |
1810 Maybe<bool> result = | 1820 Maybe<bool> result = |
1811 object->IsJSReceiver() | 1821 object->IsJSReceiver() |
1812 ? JSReceiver::IsExtensible(Handle<JSReceiver>::cast(object)) | 1822 ? JSReceiver::IsExtensible(Handle<JSReceiver>::cast(object)) |
1813 : Just(false); | 1823 : Just(false); |
1814 MAYBE_RETURN(result, isolate->heap()->exception()); | 1824 MAYBE_RETURN(result, isolate->heap()->exception()); |
1815 return isolate->heap()->ToBoolean(result.FromJust()); | 1825 return isolate->heap()->ToBoolean(result.FromJust()); |
(...skipping 2561 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4377 BUILTIN_LIST_C(DEFINE_BUILTIN_ACCESSOR_C) | 4387 BUILTIN_LIST_C(DEFINE_BUILTIN_ACCESSOR_C) |
4378 BUILTIN_LIST_A(DEFINE_BUILTIN_ACCESSOR_A) | 4388 BUILTIN_LIST_A(DEFINE_BUILTIN_ACCESSOR_A) |
4379 BUILTIN_LIST_H(DEFINE_BUILTIN_ACCESSOR_H) | 4389 BUILTIN_LIST_H(DEFINE_BUILTIN_ACCESSOR_H) |
4380 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A) | 4390 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A) |
4381 #undef DEFINE_BUILTIN_ACCESSOR_C | 4391 #undef DEFINE_BUILTIN_ACCESSOR_C |
4382 #undef DEFINE_BUILTIN_ACCESSOR_A | 4392 #undef DEFINE_BUILTIN_ACCESSOR_A |
4383 | 4393 |
4384 | 4394 |
4385 } // namespace internal | 4395 } // namespace internal |
4386 } // namespace v8 | 4396 } // namespace v8 |
OLD | NEW |