Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(92)

Side by Side Diff: src/array-iterator.js

Issue 336403002: Add @@iterator, .entries(), .values(), .keys() support to typed arrays (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | test/mjsunit/harmony/typed-array-iterator.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 InstallFunctions($Array.prototype, DONT_ENUM, $Array( 122 InstallFunctions($Array.prototype, DONT_ENUM, $Array(
123 'entries', ArrayEntries, 123 'entries', ArrayEntries,
124 'values', ArrayValues, 124 'values', ArrayValues,
125 'keys', ArrayKeys 125 'keys', ArrayKeys
126 )); 126 ));
127 127
128 %SetProperty($Array.prototype, symbolIterator, ArrayValues, 128 %SetProperty($Array.prototype, symbolIterator, ArrayValues,
129 DONT_ENUM | DONT_DELETE | READ_ONLY); 129 DONT_ENUM | DONT_DELETE | READ_ONLY);
130 } 130 }
131 ExtendArrayPrototype(); 131 ExtendArrayPrototype();
132
133
134 function ExtendTypedArrayPrototypes() {
135 %CheckIsBootstrapping();
136
137 macro TYPED_ARRAYS(FUNCTION)
138 FUNCTION(Uint8Array)
139 FUNCTION(Int8Array)
140 FUNCTION(Uint16Array)
141 FUNCTION(Int16Array)
142 FUNCTION(Uint32Array)
143 FUNCTION(Int32Array)
144 FUNCTION(Float32Array)
145 FUNCTION(Float64Array)
146 FUNCTION(Uint8ClampedArray)
147 endmacro
148
149 macro EXTEND_TYPED_ARRAY(NAME)
150 %SetProperty(global.NAME.prototype, 'entries', ArrayEntries, DONT_ENUM);
rossberg 2014/06/18 09:38:01 Why do you need. 'global.' here?
151 %SetProperty(global.NAME.prototype, 'values', ArrayValues, DONT_ENUM);
152 %SetProperty(global.NAME.prototype, 'keys', ArrayKeys, DONT_ENUM);
153 %SetProperty(global.NAME.prototype, symbolIterator, ArrayValues, DONT_ENUM);
154 endmacro
155
156 TYPED_ARRAYS(EXTEND_TYPED_ARRAY)
157 }
158 ExtendTypedArrayPrototypes();
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/harmony/typed-array-iterator.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698