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 1162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1173 | 1173 |
1174 | 1174 |
1175 function GetOwnEnumerablePropertyNames(object) { | 1175 function GetOwnEnumerablePropertyNames(object) { |
1176 var names = new InternalArray(); | 1176 var names = new InternalArray(); |
1177 for (var key in object) { | 1177 for (var key in object) { |
1178 if (%HasOwnProperty(object, key)) { | 1178 if (%HasOwnProperty(object, key)) { |
1179 names.push(key); | 1179 names.push(key); |
1180 } | 1180 } |
1181 } | 1181 } |
1182 | 1182 |
1183 // FLAG_harmony_symbols may be on, but symbols aren't included by for-in. | |
1184 var filter = PROPERTY_ATTRIBUTES_STRING | PROPERTY_ATTRIBUTES_PRIVATE_SYMBOL; | 1183 var filter = PROPERTY_ATTRIBUTES_STRING | PROPERTY_ATTRIBUTES_PRIVATE_SYMBOL; |
1185 var symbols = %GetOwnPropertyNames(object, filter); | 1184 var symbols = %GetOwnPropertyNames(object, filter); |
1186 for (var i = 0; i < symbols.length; ++i) { | 1185 for (var i = 0; i < symbols.length; ++i) { |
1187 var symbol = symbols[i]; | 1186 var symbol = symbols[i]; |
1188 if (IS_SYMBOL(symbol)) { | 1187 if (IS_SYMBOL(symbol)) { |
1189 var desc = ObjectGetOwnPropertyDescriptor(object, symbol); | 1188 var desc = ObjectGetOwnPropertyDescriptor(object, symbol); |
1190 if (desc.enumerable) names.push(symbol); | 1189 if (desc.enumerable) names.push(symbol); |
1191 } | 1190 } |
1192 } | 1191 } |
1193 | 1192 |
(...skipping 675 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1869 %SetCode($Function, FunctionConstructor); | 1868 %SetCode($Function, FunctionConstructor); |
1870 %AddNamedProperty($Function.prototype, "constructor", $Function, DONT_ENUM); | 1869 %AddNamedProperty($Function.prototype, "constructor", $Function, DONT_ENUM); |
1871 | 1870 |
1872 InstallFunctions($Function.prototype, DONT_ENUM, $Array( | 1871 InstallFunctions($Function.prototype, DONT_ENUM, $Array( |
1873 "bind", FunctionBind, | 1872 "bind", FunctionBind, |
1874 "toString", FunctionToString | 1873 "toString", FunctionToString |
1875 )); | 1874 )); |
1876 } | 1875 } |
1877 | 1876 |
1878 SetUpFunction(); | 1877 SetUpFunction(); |
OLD | NEW |