OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 'use strict'; | 5 'use strict'; |
6 | 6 |
7 | 7 |
8 // This file relies on the fact that the following declaration has been made | 8 // This file relies on the fact that the following declaration has been made |
9 // in runtime.js: | 9 // in runtime.js: |
10 // var $Array = global.Array; | 10 // var $Array = global.Array; |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 | 105 |
106 %FunctionSetPrototype(ArrayIterator, new $Object()); | 106 %FunctionSetPrototype(ArrayIterator, new $Object()); |
107 %FunctionSetInstanceClassName(ArrayIterator, 'Array Iterator'); | 107 %FunctionSetInstanceClassName(ArrayIterator, 'Array Iterator'); |
108 | 108 |
109 InstallFunctions(ArrayIterator.prototype, DONT_ENUM, $Array( | 109 InstallFunctions(ArrayIterator.prototype, DONT_ENUM, $Array( |
110 'next', ArrayIteratorNext | 110 'next', ArrayIteratorNext |
111 )); | 111 )); |
112 %FunctionSetName(ArrayIteratorIterator, '[Symbol.iterator]'); | 112 %FunctionSetName(ArrayIteratorIterator, '[Symbol.iterator]'); |
113 %AddNamedProperty(ArrayIterator.prototype, symbolIterator, | 113 %AddNamedProperty(ArrayIterator.prototype, symbolIterator, |
114 ArrayIteratorIterator, DONT_ENUM); | 114 ArrayIteratorIterator, DONT_ENUM); |
| 115 %AddNamedProperty(ArrayIterator.prototype, symbolToStringTag, |
| 116 "Array Iterator", READ_ONLY | DONT_ENUM); |
115 } | 117 } |
116 SetUpArrayIterator(); | 118 SetUpArrayIterator(); |
117 | 119 |
118 | 120 |
119 function ExtendArrayPrototype() { | 121 function ExtendArrayPrototype() { |
120 %CheckIsBootstrapping(); | 122 %CheckIsBootstrapping(); |
121 | 123 |
122 InstallFunctions($Array.prototype, DONT_ENUM, $Array( | 124 InstallFunctions($Array.prototype, DONT_ENUM, $Array( |
123 // No 'values' since it breaks webcompat: http://crbug.com/409858 | 125 // No 'values' since it breaks webcompat: http://crbug.com/409858 |
124 'entries', ArrayEntries, | 126 'entries', ArrayEntries, |
(...skipping 23 matching lines...) Expand all Loading... |
148 macro EXTEND_TYPED_ARRAY(NAME) | 150 macro EXTEND_TYPED_ARRAY(NAME) |
149 %AddNamedProperty($NAME.prototype, 'entries', ArrayEntries, DONT_ENUM); | 151 %AddNamedProperty($NAME.prototype, 'entries', ArrayEntries, DONT_ENUM); |
150 %AddNamedProperty($NAME.prototype, 'values', ArrayValues, DONT_ENUM); | 152 %AddNamedProperty($NAME.prototype, 'values', ArrayValues, DONT_ENUM); |
151 %AddNamedProperty($NAME.prototype, 'keys', ArrayKeys, DONT_ENUM); | 153 %AddNamedProperty($NAME.prototype, 'keys', ArrayKeys, DONT_ENUM); |
152 %AddNamedProperty($NAME.prototype, symbolIterator, ArrayValues, DONT_ENUM); | 154 %AddNamedProperty($NAME.prototype, symbolIterator, ArrayValues, DONT_ENUM); |
153 endmacro | 155 endmacro |
154 | 156 |
155 TYPED_ARRAYS(EXTEND_TYPED_ARRAY) | 157 TYPED_ARRAYS(EXTEND_TYPED_ARRAY) |
156 } | 158 } |
157 ExtendTypedArrayPrototypes(); | 159 ExtendTypedArrayPrototypes(); |
OLD | NEW |