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

Side by Side Diff: test/mjsunit/regress/regress-crbug-691323.js

Issue 2714793004: Merged: [elements] Check if the backing store has been neutered for indexOf (Closed)
Patch Set: 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/elements.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2017 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 // Flags: --allow-natives-syntax
6 var buffer = new ArrayBuffer(0x100);
7 var array = new Uint8Array(buffer).fill(55);
8 var tmp = {};
9 tmp[Symbol.toPrimitive] = function () {
10 %ArrayBufferNeuter(array.buffer)
11 return 0;
12 };
13
14
15 assertEquals(-1, Array.prototype.indexOf.call(array, 0x00, tmp));
16
17 buffer = new ArrayBuffer(0x100);
18 array = new Uint8Array(buffer).fill(55);
19 tmp = {};
20 tmp[Symbol.toPrimitive] = function () {
21 %ArrayBufferNeuter(array.buffer)
22 return 0;
23 };
24
25
26 assertEquals(false, Array.prototype.includes.call(array, 0x00, tmp));
27
28 buffer = new ArrayBuffer(0x100);
29 array = new Uint8Array(buffer).fill(55);
30 tmp = {};
31 tmp[Symbol.toPrimitive] = function () {
32 %ArrayBufferNeuter(array.buffer)
33 return 0;
34 };
35 assertEquals(true, Array.prototype.includes.call(array, undefined, tmp));
OLDNEW
« no previous file with comments | « src/elements.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698