| 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 (function(global, utils) { | 5 (function(global, utils) { |
| 6 | 6 |
| 7 %CheckIsBootstrapping(); | 7 %CheckIsBootstrapping(); |
| 8 | 8 |
| 9 // ---------------------------------------------------------------------------- | 9 // ---------------------------------------------------------------------------- |
| 10 // Imports | 10 // Imports |
| 11 | 11 |
| 12 var GlobalArray = global.Array; | 12 var GlobalArray = global.Array; |
| 13 var GlobalBoolean = global.Boolean; | 13 var GlobalBoolean = global.Boolean; |
| 14 var GlobalFunction = global.Function; | |
| 15 var GlobalNumber = global.Number; | 14 var GlobalNumber = global.Number; |
| 16 var GlobalObject = global.Object; | 15 var GlobalObject = global.Object; |
| 17 var InternalArray = utils.InternalArray; | 16 var InternalArray = utils.InternalArray; |
| 18 var iteratorSymbol = utils.ImportNow("iterator_symbol"); | 17 var iteratorSymbol = utils.ImportNow("iterator_symbol"); |
| 19 var MakeRangeError; | 18 var MakeRangeError; |
| 20 var MakeSyntaxError; | 19 var MakeSyntaxError; |
| 21 var MakeTypeError; | 20 var MakeTypeError; |
| 22 var MathAbs; | 21 var MathAbs; |
| 23 var NaN = %GetRootNaN(); | 22 var NaN = %GetRootNaN(); |
| 24 var ObjectToString = utils.ImportNow("object_to_string"); | 23 var ObjectToString = utils.ImportNow("object_to_string"); |
| (...skipping 1134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1159 "isNaN", NumberIsNaN, | 1158 "isNaN", NumberIsNaN, |
| 1160 "isSafeInteger", NumberIsSafeInteger, | 1159 "isSafeInteger", NumberIsSafeInteger, |
| 1161 "parseInt", GlobalParseInt, | 1160 "parseInt", GlobalParseInt, |
| 1162 "parseFloat", GlobalParseFloat | 1161 "parseFloat", GlobalParseFloat |
| 1163 ]); | 1162 ]); |
| 1164 | 1163 |
| 1165 %SetForceInlineFlag(NumberIsNaN); | 1164 %SetForceInlineFlag(NumberIsNaN); |
| 1166 | 1165 |
| 1167 | 1166 |
| 1168 // ---------------------------------------------------------------------------- | 1167 // ---------------------------------------------------------------------------- |
| 1169 // Function | |
| 1170 | |
| 1171 // ---------------------------------------------------------------------------- | |
| 1172 | |
| 1173 %AddNamedProperty(GlobalFunction.prototype, "constructor", GlobalFunction, | |
| 1174 DONT_ENUM); | |
| 1175 | |
| 1176 // ---------------------------------------------------------------------------- | |
| 1177 // Iterator related spec functions. | 1168 // Iterator related spec functions. |
| 1178 | 1169 |
| 1179 // ES6 7.4.1 GetIterator(obj, method) | 1170 // ES6 7.4.1 GetIterator(obj, method) |
| 1180 function GetIterator(obj, method) { | 1171 function GetIterator(obj, method) { |
| 1181 if (IS_UNDEFINED(method)) { | 1172 if (IS_UNDEFINED(method)) { |
| 1182 method = obj[iteratorSymbol]; | 1173 method = obj[iteratorSymbol]; |
| 1183 } | 1174 } |
| 1184 if (!IS_CALLABLE(method)) { | 1175 if (!IS_CALLABLE(method)) { |
| 1185 throw MakeTypeError(kNotIterable, obj); | 1176 throw MakeTypeError(kNotIterable, obj); |
| 1186 } | 1177 } |
| (...skipping 16 matching lines...) Expand all Loading... |
| 1203 to.ObjectDefineProperties = ObjectDefineProperties; | 1194 to.ObjectDefineProperties = ObjectDefineProperties; |
| 1204 to.ObjectDefineProperty = ObjectDefineProperty; | 1195 to.ObjectDefineProperty = ObjectDefineProperty; |
| 1205 to.ObjectHasOwnProperty = ObjectHasOwnProperty; | 1196 to.ObjectHasOwnProperty = ObjectHasOwnProperty; |
| 1206 }); | 1197 }); |
| 1207 | 1198 |
| 1208 %InstallToContext([ | 1199 %InstallToContext([ |
| 1209 "object_value_of", ObjectValueOf, | 1200 "object_value_of", ObjectValueOf, |
| 1210 ]); | 1201 ]); |
| 1211 | 1202 |
| 1212 }) | 1203 }) |
| OLD | NEW |