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 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
208 "eval", GlobalEval | 208 "eval", GlobalEval |
209 )); | 209 )); |
210 } | 210 } |
211 | 211 |
212 SetUpGlobal(); | 212 SetUpGlobal(); |
213 | 213 |
214 | 214 |
215 // ---------------------------------------------------------------------------- | 215 // ---------------------------------------------------------------------------- |
216 // Object | 216 // Object |
217 | 217 |
218 var DefaultObjectToString = ObjectToString; | |
Dmitry Lomov (no reviews)
2014/10/21 06:11:53
Please rename ObjectToString to NoSideEffectsObjec
caitp (gmail)
2014/10/21 14:54:45
Acknowledged.
| |
218 // ECMA-262 - 15.2.4.2 | 219 // ECMA-262 - 15.2.4.2 |
219 function ObjectToString() { | 220 function ObjectToString() { |
220 if (IS_UNDEFINED(this) && !IS_UNDETECTABLE(this)) return "[object Undefined]"; | 221 if (IS_UNDEFINED(this) && !IS_UNDETECTABLE(this)) return "[object Undefined]"; |
221 if (IS_NULL(this)) return "[object Null]"; | 222 if (IS_NULL(this)) return "[object Null]"; |
222 return "[object " + %_ClassOf(ToObject(this)) + "]"; | 223 return "[object " + %_ClassOf(ToObject(this)) + "]"; |
223 } | 224 } |
224 | 225 |
225 | 226 |
226 // ECMA-262 - 15.2.4.3 | 227 // ECMA-262 - 15.2.4.3 |
227 function ObjectToLocaleString() { | 228 function ObjectToLocaleString() { |
(...skipping 1673 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1901 } | 1902 } |
1902 if (!IS_SPEC_FUNCTION(method)) { | 1903 if (!IS_SPEC_FUNCTION(method)) { |
1903 throw MakeTypeError('not_iterable', [obj]); | 1904 throw MakeTypeError('not_iterable', [obj]); |
1904 } | 1905 } |
1905 var iterator = %_CallFunction(obj, method); | 1906 var iterator = %_CallFunction(obj, method); |
1906 if (!IS_SPEC_OBJECT(iterator)) { | 1907 if (!IS_SPEC_OBJECT(iterator)) { |
1907 throw MakeTypeError('not_an_iterator', [iterator]); | 1908 throw MakeTypeError('not_an_iterator', [iterator]); |
1908 } | 1909 } |
1909 return iterator; | 1910 return iterator; |
1910 } | 1911 } |
OLD | NEW |