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

Side by Side Diff: test/mjsunit/es6/typedarray-copywithin.js

Issue 2693753002: Revert of [typedarrays] move %TypedArray%.prototype.copyWithin to C++ (Closed)
Patch Set: Fix merge conflict Created 3 years, 10 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
« no previous file with comments | « src/js/typedarray.js ('k') | test/test262/test262.status » ('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 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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 var typedArrayConstructors = [ 5 var typedArrayConstructors = [
6 Uint8Array, 6 Uint8Array,
7 Int8Array, 7 Int8Array,
8 Uint16Array, 8 Uint16Array,
9 Int16Array, 9 Int16Array,
10 Uint32Array, 10 Uint32Array,
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 // test array length remains same 164 // test array length remains same
165 assertEquals(large, arr.length); 165 assertEquals(large, arr.length);
166 }); 166 });
167 167
168 168
169 CheckEachTypedArray(function copyWithinNullEnd(constructor) { 169 CheckEachTypedArray(function copyWithinNullEnd(constructor) {
170 // test null on third argument is converted to +0 170 // test null on third argument is converted to +0
171 assertArrayEquals([1, 2, 3, 4, 5], 171 assertArrayEquals([1, 2, 3, 4, 5],
172 new constructor([1, 2, 3, 4, 5]).copyWithin(0, 3, null)); 172 new constructor([1, 2, 3, 4, 5]).copyWithin(0, 3, null));
173 }); 173 });
174
175
176 CheckEachTypedArray(function copyWithinMinusInfinityTarget(constructor) {
177 var arr = new constructor([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]);
178 var expected = [6, 7, 8, 9, 10, 6, 7, 8, 9, 10];
179
180 assertArrayEquals(expected, arr.copyWithin(-Infinity, 5));
181 assertEquals(10, arr.length);
182 });
183
184
185 CheckEachTypedArray(function copyWithinPositiveInfinityTarget(constructor) {
186 var arr = new constructor([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]);
187 var expected = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
188
189 assertArrayEquals(expected, arr.copyWithin(+Infinity, 5));
190 assertEquals(10, arr.length);
191 });
192
193
194 CheckEachTypedArray(function copyWithinMinusInfinityStart(constructor) {
195 var arr = new constructor([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]);
196 var expected = [1, 2, 3, 4, 5, 1, 2, 3, 4, 5];
197
198 assertArrayEquals(expected, arr.copyWithin(5, -Infinity));
199 assertEquals(10, arr.length);
200 });
201
202
203 CheckEachTypedArray(function copyWithinPositiveInfinityStart(constructor) {
204 var arr = new constructor([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]);
205 var expected = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
206
207 assertArrayEquals(expected, arr.copyWithin(5, +Infinity));
208 assertEquals(10, arr.length);
209 });
210
211
212 CheckEachTypedArray(function copyWithinMinusInfinityEnd(constructor) {
213 var arr = new constructor([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]);
214 var expected = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
215
216 assertArrayEquals(expected, arr.copyWithin(5, 0, -Infinity));
217 assertEquals(10, arr.length);
218 });
219
220
221 CheckEachTypedArray(function copyWithinPositiveInfinityEnd(constructor) {
222 var arr = new constructor([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]);
223 var expected = [1, 2, 3, 4, 5, 1, 2, 3, 4, 5];
224
225 assertArrayEquals(expected, arr.copyWithin(5, 0, +Infinity));
226 assertEquals(10, arr.length);
227 });
OLDNEW
« no previous file with comments | « src/js/typedarray.js ('k') | test/test262/test262.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698