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

Side by Side Diff: test/mjsunit/harmony/class-fields-to-name.js

Issue 2330473002: Class fields, part 3 (backends)
Patch Set: bytecode test 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
6
7 {
8 let hits = 0;
9 let coercible = { toString(){ ++hits; return 'a'; } };
10
11 class C {
12 [coercible] = 0;
13 }
14
15 assertEquals(1, hits);
16
17 new C;
18 new C;
19
20 assertEquals(1, hits);
21
22 assertEquals(0, (new C).a);
23 }
24
25 {
26 let hits = 0;
27 let coercible = { toString(){ ++hits; return 'a'; } };
28
29 class C {
30 static [coercible] = 0;
31 }
32
33 assertEquals(1, hits);
34
35 new C;
36 new C;
37
38 assertEquals(1, hits);
39
40 assertEquals(0, C.a);
41 }
OLDNEW
« no previous file with comments | « test/mjsunit/harmony/class-fields-syntax.js ('k') | test/mjsunit/harmony/class-fields-visibility.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698