OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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() { | 5 (function() { |
6 | 6 |
7 "use strict"; | 7 "use strict"; |
8 | 8 |
9 %CheckIsBootstrapping(); | 9 %CheckIsBootstrapping(); |
10 | 10 |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 if (%IsSloppyModeFunction(mapfn)) receiver = UNDEFINED; | 48 if (%IsSloppyModeFunction(mapfn)) receiver = UNDEFINED; |
49 } else if (!IS_UNDEFINED(receiver)) { | 49 } else if (!IS_UNDEFINED(receiver)) { |
50 needs_wrapper = SHOULD_CREATE_WRAPPER(f, receiver); | 50 needs_wrapper = SHOULD_CREATE_WRAPPER(f, receiver); |
51 } | 51 } |
52 | 52 |
53 var stepping = DEBUG_IS_ACTIVE && %DebugCallbackSupportsStepping(f); | 53 var stepping = DEBUG_IS_ACTIVE && %DebugCallbackSupportsStepping(f); |
54 for (var i = 0; i < length; i++) { | 54 for (var i = 0; i < length; i++) { |
55 var element = this[i]; | 55 var element = this[i]; |
56 // Prepare break slots for debugger step in. | 56 // Prepare break slots for debugger step in. |
57 if (stepping) %DebugPrepareStepInIfStepping(f); | 57 if (stepping) %DebugPrepareStepInIfStepping(f); |
58 var new_receiver = needs_wrapper ? $toObject(receiver) : receiver; | 58 var new_receiver = needs_wrapper ? ToObject(receiver) : receiver; |
59 %_CallFunction(new_receiver, TO_OBJECT_INLINE(element), i, this, f); | 59 %_CallFunction(new_receiver, TO_OBJECT_INLINE(element), i, this, f); |
60 } | 60 } |
61 } | 61 } |
62 | 62 |
63 // ES6 draft 08-24-14, section 22.2.2.2 | 63 // ES6 draft 08-24-14, section 22.2.2.2 |
64 function NAMEOf() { // length == 0 | 64 function NAMEOf() { // length == 0 |
65 var length = %_ArgumentsLength(); | 65 var length = %_ArgumentsLength(); |
66 var array = new this(length); | 66 var array = new this(length); |
67 for (var i = 0; i < length; i++) { | 67 for (var i = 0; i < length; i++) { |
68 array[i] = %_Arguments(i); | 68 array[i] = %_Arguments(i); |
(...skipping 14 matching lines...) Expand all Loading... |
83 | 83 |
84 // Set up non-enumerable functions on the prototype object. | 84 // Set up non-enumerable functions on the prototype object. |
85 $installFunctions(GlobalNAME.prototype, DONT_ENUM, [ | 85 $installFunctions(GlobalNAME.prototype, DONT_ENUM, [ |
86 "forEach", NAMEForEach | 86 "forEach", NAMEForEach |
87 ]); | 87 ]); |
88 endmacro | 88 endmacro |
89 | 89 |
90 TYPED_ARRAYS(EXTEND_TYPED_ARRAY) | 90 TYPED_ARRAYS(EXTEND_TYPED_ARRAY) |
91 | 91 |
92 })(); | 92 })(); |
OLD | NEW |