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 var $delete; | 5 var $delete; |
6 var $functionSourceString; | 6 var $functionSourceString; |
7 var $getIterator; | 7 var $getIterator; |
8 var $getMethod; | 8 var $getMethod; |
9 var $globalEval; | 9 var $globalEval; |
10 var $installConstants; | 10 var $installConstants; |
11 var $installFunctions; | 11 var $installFunctions; |
12 var $installGetter; | 12 var $installGetter; |
13 var $isFinite; | 13 var $isFinite; |
14 var $isNaN; | 14 var $isNaN; |
15 var $newFunctionString; | 15 var $newFunctionString; |
16 var $numberIsNaN; | 16 var $numberIsNaN; |
17 var $objectDefineProperties; | 17 var $objectDefineProperties; |
18 var $objectDefineProperty; | 18 var $objectDefineProperty; |
19 var $objectFreeze; | 19 var $objectFreeze; |
20 var $objectGetOwnPropertyDescriptor; | 20 var $objectGetOwnPropertyDescriptor; |
21 var $objectGetOwnPropertyKeys; | 21 var $objectGetOwnPropertyKeys; |
22 var $objectHasOwnProperty; | 22 var $objectHasOwnProperty; |
23 var $objectIsFrozen; | 23 var $objectIsFrozen; |
24 var $objectIsSealed; | 24 var $objectIsSealed; |
25 var $objectLookupGetter; | 25 var $objectLookupGetter; |
26 var $objectLookupSetter; | 26 var $objectLookupSetter; |
27 var $objectToString; | 27 var $objectToString; |
28 var $overrideFunction; | 28 var $overrideFunction; |
| 29 var $ownPropertyKeys; |
29 var $setFunctionName; | 30 var $setFunctionName; |
30 var $setUpLockedPrototype; | 31 var $setUpLockedPrototype; |
31 var $toCompletePropertyDescriptor; | 32 var $toCompletePropertyDescriptor; |
32 var $toNameArray; | 33 var $toNameArray; |
33 | 34 |
34 (function() { | 35 (function() { |
35 | 36 |
36 %CheckIsBootstrapping(); | 37 %CheckIsBootstrapping(); |
37 | 38 |
38 var GlobalArray = global.Array; | 39 var GlobalArray = global.Array; |
(...skipping 1095 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1134 seenKeys[name] = true; | 1135 seenKeys[name] = true; |
1135 propertyNames[j++] = name; | 1136 propertyNames[j++] = name; |
1136 } | 1137 } |
1137 propertyNames.length = j; | 1138 propertyNames.length = j; |
1138 } | 1139 } |
1139 | 1140 |
1140 return propertyNames; | 1141 return propertyNames; |
1141 } | 1142 } |
1142 | 1143 |
1143 | 1144 |
| 1145 // ES6 section 9.1.12 / 9.5.12 |
| 1146 function OwnPropertyKeys(obj) { |
| 1147 if (%_IsJSProxy(obj)) { |
| 1148 var handler = %GetHandler(obj); |
| 1149 // TODO(caitp): Proxy.[[OwnPropertyKeys]] can not be implemented to spec |
| 1150 // without an implementation of Direct Proxies. |
| 1151 var names = CallTrap0(handler, "ownKeys", UNDEFINED); |
| 1152 return ToNameArray(names, "getOwnPropertyNames", false); |
| 1153 } |
| 1154 return ObjectGetOwnPropertyKeys(obj, PROPERTY_ATTRIBUTES_PRIVATE_SYMBOL); |
| 1155 } |
| 1156 |
| 1157 |
1144 // ES5 section 15.2.3.4. | 1158 // ES5 section 15.2.3.4. |
1145 function ObjectGetOwnPropertyNames(obj) { | 1159 function ObjectGetOwnPropertyNames(obj) { |
1146 obj = TO_OBJECT_INLINE(obj); | 1160 obj = TO_OBJECT_INLINE(obj); |
1147 // Special handling for proxies. | 1161 // Special handling for proxies. |
1148 if (%_IsJSProxy(obj)) { | 1162 if (%_IsJSProxy(obj)) { |
1149 var handler = %GetHandler(obj); | 1163 var handler = %GetHandler(obj); |
1150 var names = CallTrap0(handler, "getOwnPropertyNames", UNDEFINED); | 1164 var names = CallTrap0(handler, "getOwnPropertyNames", UNDEFINED); |
1151 return ToNameArray(names, "getOwnPropertyNames", false); | 1165 return ToNameArray(names, "getOwnPropertyNames", false); |
1152 } | 1166 } |
1153 | 1167 |
(...skipping 782 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1936 $objectFreeze = ObjectFreezeJS; | 1950 $objectFreeze = ObjectFreezeJS; |
1937 $objectGetOwnPropertyDescriptor = ObjectGetOwnPropertyDescriptor; | 1951 $objectGetOwnPropertyDescriptor = ObjectGetOwnPropertyDescriptor; |
1938 $objectGetOwnPropertyKeys = ObjectGetOwnPropertyKeys; | 1952 $objectGetOwnPropertyKeys = ObjectGetOwnPropertyKeys; |
1939 $objectHasOwnProperty = ObjectHasOwnProperty; | 1953 $objectHasOwnProperty = ObjectHasOwnProperty; |
1940 $objectIsFrozen = ObjectIsFrozen; | 1954 $objectIsFrozen = ObjectIsFrozen; |
1941 $objectIsSealed = ObjectIsSealed; | 1955 $objectIsSealed = ObjectIsSealed; |
1942 $objectLookupGetter = ObjectLookupGetter; | 1956 $objectLookupGetter = ObjectLookupGetter; |
1943 $objectLookupSetter = ObjectLookupSetter; | 1957 $objectLookupSetter = ObjectLookupSetter; |
1944 $objectToString = ObjectToString; | 1958 $objectToString = ObjectToString; |
1945 $overrideFunction = OverrideFunction; | 1959 $overrideFunction = OverrideFunction; |
| 1960 $ownPropertyKeys = OwnPropertyKeys; |
1946 $setFunctionName = SetFunctionName; | 1961 $setFunctionName = SetFunctionName; |
1947 $setUpLockedPrototype = SetUpLockedPrototype; | 1962 $setUpLockedPrototype = SetUpLockedPrototype; |
1948 $toCompletePropertyDescriptor = ToCompletePropertyDescriptor; | 1963 $toCompletePropertyDescriptor = ToCompletePropertyDescriptor; |
1949 $toNameArray = ToNameArray; | 1964 $toNameArray = ToNameArray; |
1950 | 1965 |
1951 })(); | 1966 })(); |
OLD | NEW |