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

Side by Side Diff: test/mjsunit/es6/super-with-spread-modify-array-iterator.js

Issue 2659623002: [turbofan] Reduce CallConstructWithSpread where iteration is not observable. (Closed)
Patch Set: respond to comments from Benedikt 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
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
7 (function modifyArrayIterator() {
8 'use strict';
9
10 class Point {
11 constructor(x, y) {
12 this.x = x;
13 this.y = y;
14 }
15 }
16
17 class RestPoint extends Point {
18 constructor(...args) {
19 super(...args);
20 }
21 }
22
23 function testRestPoint(x, y) {
24 return new RestPoint(x, y);
25 }
26 testRestPoint(1, 2);
27 testRestPoint(1, 2);
28 % OptimizeFunctionOnNextCall(testRestPoint);
29 var r = testRestPoint(1, 2);
30
31 assertInstanceof(r, RestPoint);
32 assertInstanceof(r, Point);
33 assertEquals(1, r.x);
34 assertEquals(2, r.y);
35
36 Object.defineProperty(Array.prototype, Symbol.iterator, {
37 value: function*
38 () {
39 yield 3;
40 yield 4;
41 },
42 configurable: true
43 });
44
45 var r2 = testRestPoint(1, 2);
46
47 assertInstanceof(r2, RestPoint);
48 assertInstanceof(r2, Point);
49 assertEquals(3, r2.x);
50 assertEquals(4, r2.y);
51 })();
OLDNEW
« no previous file with comments | « test/mjsunit/es6/super-with-spread.js ('k') | test/mjsunit/es6/super-with-spread-modify-next.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698