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

Side by Side Diff: test/mjsunit/regress/regress-353004.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-tostring.js ('k') | test/mjsunit/regress/regress-4665.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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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 buffer1 = new ArrayBuffer(100 * 1024); 7 var buffer1 = new ArrayBuffer(100 * 1024);
8 8
9 var array1 = new Uint8Array(buffer1, {valueOf : function() { 9 var array1 = new Uint8Array(buffer1, {valueOf : function() {
10 %ArrayBufferNeuter(buffer1); 10 %ArrayBufferNeuter(buffer1);
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 var buffer7 = new ArrayBuffer(100 * 1024 * 1024); 52 var buffer7 = new ArrayBuffer(100 * 1024 * 1024);
53 assertThrows(function() { 53 assertThrows(function() {
54 buffer7.slice(0, {valueOf : function() { 54 buffer7.slice(0, {valueOf : function() {
55 %ArrayBufferNeuter(buffer7); 55 %ArrayBufferNeuter(buffer7);
56 return 100 * 1024 * 1024; 56 return 100 * 1024 * 1024;
57 }}); 57 }});
58 }, TypeError); 58 }, TypeError);
59 59
60 var buffer9 = new ArrayBuffer(1024); 60 var buffer9 = new ArrayBuffer(1024);
61 var array9 = new Uint8Array(buffer9); 61 var array9 = new Uint8Array(buffer9);
62 assertThrows(() => 62 var array10 = array9.subarray({valueOf : function() {
63 array9.subarray({valueOf : function() {
64 %ArrayBufferNeuter(buffer9); 63 %ArrayBufferNeuter(buffer9);
65 return 0; 64 return 0;
66 }}, 1024), TypeError); 65 }}, 1024);
67 assertEquals(0, array9.length); 66 assertEquals(0, array9.length);
67 assertEquals(0, array10.length);
68 68
69 var buffer11 = new ArrayBuffer(1024); 69 var buffer11 = new ArrayBuffer(1024);
70 var array11 = new Uint8Array(buffer11); 70 var array11 = new Uint8Array(buffer11);
71 assertThrows(() => 71 var array12 = array11.subarray(0, {valueOf : function() {
72 array11.subarray(0, {valueOf : function() { 72 %ArrayBufferNeuter(buffer11);
73 %ArrayBufferNeuter(buffer11); 73 return 1024;
74 return 1024; 74 }});
75 }}), TypeError);
76 assertEquals(0, array11.length); 75 assertEquals(0, array11.length);
76 assertEquals(0, array12.length);
OLDNEW
« no previous file with comments | « test/mjsunit/es6/typedarray-tostring.js ('k') | test/mjsunit/regress/regress-4665.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698