OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 files contains runtime support implemented in JavaScript. | 5 // This files contains runtime support implemented in JavaScript. |
6 | 6 |
7 // CAUTION: Some of the functions specified in this file are called | 7 // CAUTION: Some of the functions specified in this file are called |
8 // directly from compiled code. These are the functions with names in | 8 // directly from compiled code. These are the functions with names in |
9 // ALL CAPS. The compiled code passes the first argument in 'this'. | 9 // ALL CAPS. The compiled code passes the first argument in 'this'. |
10 | 10 |
11 | 11 |
12 // The following declarations are shared with other native JS files. | 12 // The following declarations are shared with other native JS files. |
13 // They are all declared at this one spot to avoid redeclaration errors. | 13 // They are all declared at this one spot to avoid redeclaration errors. |
14 var $NaN; | |
15 var $sameValue; | 14 var $sameValue; |
16 var $sameValueZero; | 15 var $sameValueZero; |
17 var $toPositiveInteger; | |
18 | 16 |
19 var harmony_tolength = false; | 17 var harmony_tolength = false; |
20 | 18 |
21 (function(global, utils) { | 19 (function(global, utils) { |
22 | 20 |
23 %CheckIsBootstrapping(); | 21 %CheckIsBootstrapping(); |
24 | 22 |
25 var GlobalArray = global.Array; | 23 var GlobalArray = global.Array; |
26 var GlobalBoolean = global.Boolean; | 24 var GlobalBoolean = global.Boolean; |
27 var GlobalString = global.String; | 25 var GlobalString = global.String; |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 // NOTE: Setting the prototype for Array must take place as early as | 225 // NOTE: Setting the prototype for Array must take place as early as |
228 // possible due to code generation for array literals. When | 226 // possible due to code generation for array literals. When |
229 // generating code for a array literal a boilerplate array is created | 227 // generating code for a array literal a boilerplate array is created |
230 // that is cloned when running the code. It is essential that the | 228 // that is cloned when running the code. It is essential that the |
231 // boilerplate gets the right prototype. | 229 // boilerplate gets the right prototype. |
232 %FunctionSetPrototype(GlobalArray, new GlobalArray(0)); | 230 %FunctionSetPrototype(GlobalArray, new GlobalArray(0)); |
233 | 231 |
234 // ---------------------------------------------------------------------------- | 232 // ---------------------------------------------------------------------------- |
235 // Exports | 233 // Exports |
236 | 234 |
237 $NaN = %GetRootNaN(); | |
238 $sameValue = SameValue; | 235 $sameValue = SameValue; |
239 $sameValueZero = SameValueZero; | 236 $sameValueZero = SameValueZero; |
240 $toPositiveInteger = ToPositiveInteger; | 237 |
| 238 utils.Export(function(to) { |
| 239 to.ToPositiveInteger = ToPositiveInteger; |
| 240 }); |
241 | 241 |
242 %InstallToContext([ | 242 %InstallToContext([ |
243 "apply_prepare_builtin", APPLY_PREPARE, | 243 "apply_prepare_builtin", APPLY_PREPARE, |
244 "concat_iterable_to_array_builtin", CONCAT_ITERABLE_TO_ARRAY, | 244 "concat_iterable_to_array_builtin", CONCAT_ITERABLE_TO_ARRAY, |
245 "reflect_apply_prepare_builtin", REFLECT_APPLY_PREPARE, | 245 "reflect_apply_prepare_builtin", REFLECT_APPLY_PREPARE, |
246 "reflect_construct_prepare_builtin", REFLECT_CONSTRUCT_PREPARE, | 246 "reflect_construct_prepare_builtin", REFLECT_CONSTRUCT_PREPARE, |
247 ]); | 247 ]); |
248 | 248 |
249 %InstallToContext([ | 249 %InstallToContext([ |
250 "concat_iterable_to_array", ConcatIterableToArray, | 250 "concat_iterable_to_array", ConcatIterableToArray, |
251 ]); | 251 ]); |
252 | 252 |
253 }) | 253 }) |
OLD | NEW |