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

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

Issue 2778623003: [typedarrays] Check detached buffer at start of typed array methods (Closed)
Patch Set: pass test262 for subarray Created 3 years, 8 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/runtime/runtime-typedarray.cc ('k') | test/mjsunit/es6/typedarray-every.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 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 // Flags: --allow-natives-syntax 5 // Flags: --allow-natives-syntax
6 6
7 var typedArrayConstructors = [ 7 var typedArrayConstructors = [
8 Uint8Array, 8 Uint8Array,
9 Int8Array, 9 Int8Array,
10 Uint16Array, 10 Uint16Array,
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 [Symbol.toPrimitive]() { 233 [Symbol.toPrimitive]() {
234 assertUnreachable("Parameter should not be processed when " + 234 assertUnreachable("Parameter should not be processed when " +
235 "array.[[ViewedArrayBuffer]] is neutered."); 235 "array.[[ViewedArrayBuffer]] is neutered.");
236 return 0; 236 return 0;
237 } 237 }
238 }; 238 };
239 239
240 var array = new constructor([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]); 240 var array = new constructor([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]);
241 %ArrayBufferNeuter(array.buffer); 241 %ArrayBufferNeuter(array.buffer);
242 242
243 // TODO(caitp): this should throw due to being invoked on a TypedArray with a 243 assertThrows(() => array.copyWithin(tmp, tmp, tmp), TypeError);
244 // detached buffer (per v8:4648).
245 array.copyWithin(tmp, tmp, tmp);
246 assertEquals(0, array.length, "array.[[ViewedArrayBuffer]] is detached"); 244 assertEquals(0, array.length, "array.[[ViewedArrayBuffer]] is detached");
247 }); 245 });
OLDNEW
« no previous file with comments | « src/runtime/runtime-typedarray.cc ('k') | test/mjsunit/es6/typedarray-every.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698