| 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 // This file relies on the fact that the following declarations have been made | 5 // This file relies on the fact that the following declarations have been made |
| 6 // in runtime.js: | 6 // in runtime.js: |
| 7 // var $Object = global.Object; | 7 // var $Object = global.Object; |
| 8 // var $Boolean = global.Boolean; | 8 // var $Boolean = global.Boolean; |
| 9 // var $Number = global.Number; | 9 // var $Number = global.Number; |
| 10 // var $Function = global.Function; | 10 // var $Function = global.Function; |
| (...skipping 1023 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1034 names[s] = 0; | 1034 names[s] = 0; |
| 1035 } | 1035 } |
| 1036 array.length = realLength; | 1036 array.length = realLength; |
| 1037 return array; | 1037 return array; |
| 1038 } | 1038 } |
| 1039 | 1039 |
| 1040 | 1040 |
| 1041 function ObjectGetOwnPropertyKeys(obj, filter) { | 1041 function ObjectGetOwnPropertyKeys(obj, filter) { |
| 1042 var nameArrays = new InternalArray(); | 1042 var nameArrays = new InternalArray(); |
| 1043 filter |= PROPERTY_ATTRIBUTES_PRIVATE_SYMBOL; | 1043 filter |= PROPERTY_ATTRIBUTES_PRIVATE_SYMBOL; |
| 1044 var interceptorInfo = %GetInterceptorInfo(obj); |
| 1044 | 1045 |
| 1045 // Find all the indexed properties. | 1046 // Find all the indexed properties. |
| 1046 | 1047 |
| 1047 // Only get own element names if we want to include string keys. | 1048 // Only get own element names if we want to include string keys. |
| 1048 if ((filter & PROPERTY_ATTRIBUTES_STRING) === 0) { | 1049 if ((filter & PROPERTY_ATTRIBUTES_STRING) === 0) { |
| 1049 var ownElementNames = %GetOwnElementNames(obj); | 1050 var ownElementNames = %GetOwnElementNames(obj); |
| 1050 for (var i = 0; i < ownElementNames.length; ++i) { | 1051 for (var i = 0; i < ownElementNames.length; ++i) { |
| 1051 ownElementNames[i] = %_NumberToString(ownElementNames[i]); | 1052 ownElementNames[i] = %_NumberToString(ownElementNames[i]); |
| 1052 } | 1053 } |
| 1053 nameArrays.push(ownElementNames); | 1054 nameArrays.push(ownElementNames); |
| 1054 | |
| 1055 // Get names for indexed interceptor properties. | 1055 // Get names for indexed interceptor properties. |
| 1056 var interceptorInfo = %GetInterceptorInfo(obj); | |
| 1057 if ((interceptorInfo & 1) != 0) { | 1056 if ((interceptorInfo & 1) != 0) { |
| 1058 var indexedInterceptorNames = %GetIndexedInterceptorElementNames(obj); | 1057 var indexedInterceptorNames = %GetIndexedInterceptorElementNames(obj); |
| 1059 if (!IS_UNDEFINED(indexedInterceptorNames)) { | 1058 if (!IS_UNDEFINED(indexedInterceptorNames)) { |
| 1060 nameArrays.push(indexedInterceptorNames); | 1059 nameArrays.push(indexedInterceptorNames); |
| 1061 } | 1060 } |
| 1062 } | 1061 } |
| 1063 } | 1062 } |
| 1064 | 1063 |
| 1065 // Find all the named properties. | 1064 // Find all the named properties. |
| 1066 | 1065 |
| (...skipping 834 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1901 } | 1900 } |
| 1902 if (!IS_SPEC_FUNCTION(method)) { | 1901 if (!IS_SPEC_FUNCTION(method)) { |
| 1903 throw MakeTypeError('not_iterable', [obj]); | 1902 throw MakeTypeError('not_iterable', [obj]); |
| 1904 } | 1903 } |
| 1905 var iterator = %_CallFunction(obj, method); | 1904 var iterator = %_CallFunction(obj, method); |
| 1906 if (!IS_SPEC_OBJECT(iterator)) { | 1905 if (!IS_SPEC_OBJECT(iterator)) { |
| 1907 throw MakeTypeError('not_an_iterator', [iterator]); | 1906 throw MakeTypeError('not_an_iterator', [iterator]); |
| 1908 } | 1907 } |
| 1909 return iterator; | 1908 return iterator; |
| 1910 } | 1909 } |
| OLD | NEW |