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

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

Issue 2793233003: Revert of [typedarrays] Check detached buffer at start of typed array methods (Closed)
Patch Set: 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 | « test/mjsunit/es6/typedarray-reduce.js ('k') | test/mjsunit/es6/typedarray-slice.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
6
7 function ArrayMaker(x) { 5 function ArrayMaker(x) {
8 return x; 6 return x;
9 } 7 }
10 ArrayMaker.prototype = Array.prototype; 8 ArrayMaker.prototype = Array.prototype;
11 9
12 var arrayConstructors = [ 10 var arrayConstructors = [
13 Uint8Array, 11 Uint8Array,
14 Int8Array, 12 Int8Array,
15 Uint16Array, 13 Uint16Array,
16 Int16Array, 14 Int16Array,
(...skipping 29 matching lines...) Expand all
46 } else { 44 } else {
47 // Array.reverse works on array-like objects 45 // Array.reverse works on array-like objects
48 var x = { length: 2, 1: 5 }; 46 var x = { length: 2, 1: 5 };
49 a.reverse.call(x); 47 a.reverse.call(x);
50 assertEquals(2, x.length); 48 assertEquals(2, x.length);
51 assertFalse(Object.hasOwnProperty(x, '1')); 49 assertFalse(Object.hasOwnProperty(x, '1'));
52 assertEquals(5, x[0]); 50 assertEquals(5, x[0]);
53 } 51 }
54 52
55 assertEquals(0, a.reverse.length); 53 assertEquals(0, a.reverse.length);
56
57 // Detached Operation
58 if (constructor != ArrayMaker) {
59 var array = new constructor([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]);
60 %ArrayBufferNeuter(array.buffer);
61 assertThrows(() => array.reverse(), TypeError);
62 }
63 } 54 }
OLDNEW
« no previous file with comments | « test/mjsunit/es6/typedarray-reduce.js ('k') | test/mjsunit/es6/typedarray-slice.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698