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

Side by Side Diff: tests/language/regress_13494_test.dart

Issue 25877002: Don't evaluate the argument twice for unresolved static setter calls. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Change status for VM and dart2dart. Created 7 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 // Regression test for dart2js. Test that the argument to an unresolved static
6 // getter is only evaluated once.
7
5 import "package:expect/expect.dart"; 8 import "package:expect/expect.dart";
6 9
7 class A { 10 int i = 0;
8 factory A() => 42; 11
9 } 12 p(x) => i++;
13
14 class A {}
10 15
11 main() { 16 main() {
12 bool isCheckedMode = false; 17 bool caught = false;
13 try { 18 try {
14 String a = 42; 19 A.unknown = p(2);
15 } catch (e) { 20 } catch (_) {
16 isCheckedMode = true; 21 caught = true;
17 } 22 }
18 if (isCheckedMode) { 23 Expect.isTrue(caught);
19 Expect.throws(() => new A(), (e) => e is TypeError); 24 Expect.equals(1, i);
20 } else {
21 Expect.equals(42, new A());
22 }
23 } 25 }
OLDNEW
« sdk/lib/_internal/compiler/implementation/ssa/builder.dart ('K') | « tests/co19/co19-runtime.status ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698