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

Side by Side Diff: pkg/kernel/testcases/interpreter/object_property_access.dart

Issue 2999673002: Implement support for property accessors (Closed)
Patch Set: Created 3 years, 4 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 (c) 2017, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file.
4
5 library object_property_access_test;
6
7 main() {
8 var a1 = new A();
9 print(a1.a);
10 print(a1.b);
11
12 a1.a = 3;
13 print(a1.doubleA);
14
15 var a2 = new A.withArgs(1, 2);
16 print(a2.a);
17 print(a2.b);
18
19 print(a2.doubleA);
20 a2.setA = 42;
21 print(a2.a);
22 }
23
24 class A {
25 int a;
26 int b = 42;
27
28 A();
29 A.withArgs(this.a, this.b);
30
31 int get doubleA => a + a;
32
33 void set setA(int a) {
34 this.a = a;
35 }
36 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698