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

Side by Side Diff: dart/tests/compiler/dart2js_extra/naming_test.dart

Issue 10831332: Support new getter syntax. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Address review comments and disable one test. Created 8 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 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. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 // TODO(ahe): This is a copy of 5 // TODO(ahe): This is a copy of
6 // ../../../../tests/language/src/NamingTest.dart and should be 6 // ../../../../tests/language/src/NamingTest.dart and should be
7 // deleted when the one TODO below is addressed. 7 // deleted when the one TODO below is addressed.
8 8
9 class A { 9 class A {
10 A() { NamingTest.count++; } 10 A() { NamingTest.count++; }
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 Expect.equals(12, this.__PROTO__$()); 155 Expect.equals(12, this.__PROTO__$());
156 Expect.equals(10, this.prototype$()); 156 Expect.equals(10, this.prototype$());
157 Expect.equals(12, __PROTO__$()); 157 Expect.equals(12, __PROTO__$());
158 } 158 }
159 } 159 }
160 160
161 class Bug4082360 { 161 class Bug4082360 {
162 int x_; 162 int x_;
163 Bug4082360() {} 163 Bug4082360() {}
164 164
165 int get x() { return x_; } 165 int get x { return x_; }
166 void set x(int value) { x_ = value; } 166 void set x(int value) { x_ = value; }
167 167
168 void indirectSet(int value) { x = value; } 168 void indirectSet(int value) { x = value; }
169 169
170 static void test() { 170 static void test() {
171 var bug = new Bug4082360(); 171 var bug = new Bug4082360();
172 bug.indirectSet(42); 172 bug.indirectSet(42);
173 Expect.equals(42, bug.x_); 173 Expect.equals(42, bug.x_);
174 Expect.equals(42, bug.x); 174 Expect.equals(42, bug.x);
175 } 175 }
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after
503 503
504 static void main(args) { 504 static void main(args) {
505 var a = new Naming1Test.foo(); 505 var a = new Naming1Test.foo();
506 a.foo(); 506 a.foo();
507 } 507 }
508 } 508 }
509 509
510 // Ensure we don't have false positive. 510 // Ensure we don't have false positive.
511 class Naming2Test { 511 class Naming2Test {
512 Naming2Test() { } 512 Naming2Test() { }
513 int get foo() { return 1; } 513 int get foo { return 1; }
514 set foo(x) { } 514 set foo(x) { }
515 515
516 static void main(args) { 516 static void main(args) {
517 var a = new Naming2Test(); 517 var a = new Naming2Test();
518 Expect.throws(() => a.foo(2), (e) => e is ObjectNotClosureException); 518 Expect.throws(() => a.foo(2), (e) => e is ObjectNotClosureException);
519 } 519 }
520 } 520 }
521 521
522 main() { 522 main() {
523 NamingTest.testMain(); 523 NamingTest.testMain();
524 Naming1Test.main(null); 524 Naming1Test.main(null);
525 Naming2Test.main(null); 525 Naming2Test.main(null);
526 } 526 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698