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

Side by Side Diff: test/mjsunit/harmony/regress/regress-4395.js

Issue 1414733005: [es6] Handle super properly when rewriting arrow parameter initializers (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebased Created 5 years, 2 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/ast-expression-visitor.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
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 // Flags: --harmony-destructuring --harmony-default-parameters 5 // Flags: --harmony-destructuring --harmony-default-parameters
6 6
7 (function testExpressionTypes() { 7 (function testExpressionTypes() {
8 "use strict"; 8 "use strict";
9 ((x, y = x) => assertEquals(42, y))(42); 9 ((x, y = x) => assertEquals(42, y))(42);
10 10
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 })) => assertEquals(42, y.z))(42); 47 })) => assertEquals(42, y.z))(42);
48 48
49 ((x, y = (new class extends x { 49 ((x, y = (new class extends x {
50 })) => assertEquals(42, y.z()))(class { z() { return 42 } }); 50 })) => assertEquals(42, y.z()))(class { z() { return 42 } });
51 51
52 // Defaults inside destructuring 52 // Defaults inside destructuring
53 ((x, {y = x}) => assertEquals(42, y))(42, {}); 53 ((x, {y = x}) => assertEquals(42, y))(42, {});
54 ((x, [y = x]) => assertEquals(42, y))(42, []); 54 ((x, [y = x]) => assertEquals(42, y))(42, []);
55 })(); 55 })();
56 56
57
57 (function testMultiScopeCapture() { 58 (function testMultiScopeCapture() {
58 "use strict"; 59 "use strict";
59 var x = 1; 60 var x = 1;
60 { 61 {
61 let y = 2; 62 let y = 2;
62 ((x, y, a = x, b = y) => { 63 ((x, y, a = x, b = y) => {
63 assertEquals(3, x); 64 assertEquals(3, x);
64 assertEquals(3, a); 65 assertEquals(3, a);
65 assertEquals(4, y); 66 assertEquals(4, y);
66 assertEquals(4, b); 67 assertEquals(4, b);
67 })(3, 4); 68 })(3, 4);
68 } 69 }
69 })(); 70 })();
71
72
73 (function testSuper() {
74 "use strict";
75 class A {
76 x() { return 42; }
77 }
78
79 class B extends A {
80 y() {
81 ((q = super.x()) => assertEquals(42, q))();
82 }
83 }
84
85 new B().y();
86
87 class C {
88 constructor() { return { prop: 42 } }
89 }
90
91 class D extends C{
92 constructor() {
93 ((q = super()) => assertEquals(42, q.prop))();
94 }
95 }
96
97 new D();
98 })();
OLDNEW
« no previous file with comments | « src/ast-expression-visitor.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698