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

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

Issue 2655623004: [runtime] Fix Array.prototype.concat with complex @@species (Closed)
Patch Set: fixing argument type 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/builtins/builtins-array.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: --expose-gc
6
7 var proxy = new Proxy([], {
8 defineProperty() {
9 w.length = 1; // shorten the array so the backstore pointer is relocated
10 gc(); // force gc to move the array's elements backstore
11 return Object.defineProperty.apply(this, arguments);
12 }
13 });
14
15 class MyArray extends Array {
16 // custom constructor which returns a proxy object
17 static get[Symbol.species](){
18 return function() {
19 return proxy;
20 }
21 };
22 }
23
24 var w = new MyArray(100);
25 w[1] = 0.1;
26 w[2] = 0.1;
27
28 var result = Array.prototype.concat.call(w);
29
30 assertEquals(undefined, result[0]);
31 assertEquals(0.1, result[1]);
32
33 for (var i = 2; i < 200; i++) {
34 assertEquals(undefined, result[i]);
35 }
OLDNEW
« no previous file with comments | « src/builtins/builtins-array.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698