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

Side by Side Diff: test/mjsunit/harmony/class-privates-evaluation-order.js

Issue 2329703002: Private fields
Patch Set: some comments Created 4 years, 3 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 2016 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: --harmony-class-fields --harmony-private-class-fields
6
7 {
8 let effects = [];
9 class C {
10 [effects.push(0)] = effects.push(2);
11 #a = effects.push(3);
12 [effects.push(1)] = effects.push(4);
13 #b = effects.push(5);
14
15 constructor() {
16 effects.push(6);
17 }
18 }
19
20 assertArrayEquals([0, 1], effects);
21 new C;
22 assertArrayEquals([0, 1, 2, 3, 4, 5, 6], effects);
23 }
24
25 {
26 let effects = [];
27
28 class Base {
29 #a = effects.push(1);
30
31 constructor() {
32 effects.push(2);
33 }
34 }
35
36 class Derived extends Base {
37 #a = effects.push(3);
38
39 constructor() {
40 effects.push(0);
41 super();
42 effects.push(4);
43 }
44 }
45
46 new Derived;
47 assertArrayEquals([0, 1, 2, 3, 4], effects);
48 }
49
50 // TODO(bakkot) figure out how duplicate fields work
OLDNEW
« no previous file with comments | « test/mjsunit/harmony/class-privates-errors.js ('k') | test/mjsunit/harmony/class-privates-proxy.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698