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

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

Issue 2090193002: Array splice should only normalize deleted_elements if it's an array (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 6 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/js/array.js ('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
1 // Copyright 2016 the V8 project authors. All rights reserved. 1 // Copyright 2016 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 var a = new Array(); 5 // Slice and splice both try to set the length property of their return
6 a.constructor = Int32Array; 6 // value. Add a bogus setter to allow that.
7 a.length = 1000; // Make the length >= 1000 so UseSparseVariant returns true. 7 Object.defineProperty(Int32Array.prototype, 'length', { set(v) { } });
8 assertThrows(() => a.slice()); 8
9 (function testSlice() {
10 var a = new Array();
11 a.constructor = Int32Array;
12 a.length = 1000; // Make the length >= 1000 so UseSparseVariant returns true.
13 assertTrue(a.slice() instanceof Int32Array);
14 })();
15
16 (function testSplice() {
17 var a = new Array();
18 a.constructor = Int32Array;
19 a.length = 1000; // Make the length >= 1000 so UseSparseVariant returns true.
20 assertTrue(a.splice(1) instanceof Int32Array);
21 })();
OLDNEW
« no previous file with comments | « src/js/array.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698