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

Side by Side Diff: test/mjsunit/es6/typedarray-tostring.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 | « test/mjsunit/es6/typedarray-sort.js ('k') | test/mjsunit/regress/regress-353004.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 // Array's toString should call the object's own join method, if one exists and 5 // Array's toString should call the object's own join method, if one exists and
6 // is callable. Otherwise, just use the original Object.toString function. 6 // is callable. Otherwise, just use the original Object.toString function.
7 7
8 // Flags: --allow-natives-syntax
9
8 var typedArrayConstructors = [ 10 var typedArrayConstructors = [
9 Uint8Array, 11 Uint8Array,
10 Int8Array, 12 Int8Array,
11 Uint16Array, 13 Uint16Array,
12 Int16Array, 14 Int16Array,
13 Uint32Array, 15 Uint32Array,
14 Int32Array, 16 Int32Array,
15 Uint8ClampedArray, 17 Uint8ClampedArray,
16 Float32Array, 18 Float32Array,
17 Float64Array 19 Float64Array
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 let pushArgs = (label) => (...args) => log.push(label, args); 91 let pushArgs = (label) => (...args) => log.push(label, args);
90 92
91 let NumberToLocaleString = Number.prototype.toLocaleString; 93 let NumberToLocaleString = Number.prototype.toLocaleString;
92 Number.prototype.toLocaleString = pushArgs("Number"); 94 Number.prototype.toLocaleString = pushArgs("Number");
93 95
94 (new constructor([1, 2])).toLocaleString(); 96 (new constructor([1, 2])).toLocaleString();
95 assertEquals(["Number", [], "Number", []], log); 97 assertEquals(["Number", [], "Number", []], log);
96 98
97 Number.prototype.toLocaleString = NumberToLocaleString; 99 Number.prototype.toLocaleString = NumberToLocaleString;
98 })(); 100 })();
101
102 // Detached Operation
103 var array = new constructor([1, 2, 3]);
104 %ArrayBufferNeuter(array.buffer);
105 assertThrows(() => array.join(), TypeError);
106 assertThrows(() => array.toLocalString(), TypeError);
107 assertThrows(() => array.toString(), TypeError);
99 } 108 }
OLDNEW
« no previous file with comments | « test/mjsunit/es6/typedarray-sort.js ('k') | test/mjsunit/regress/regress-353004.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698