Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2011, 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 // Test that a getter is evaluated after the arguments, when a getter is | |
|
ahe
2011/10/19 10:59:15
Please add at least one empty line between the fil
ngeoffray
2011/10/19 13:03:41
Done.
| |
| 5 // for invoking a method. See chapter 'Method Invocation' in specification. | |
| 6 | |
| 7 var counter = 0; | |
| 8 | |
| 9 get a() { | |
| 10 Expect.equals(1, counter); | |
| 11 counter++; | |
| 12 return (c) { }; | |
| 13 } | |
| 14 | |
| 15 b() { | |
| 16 Expect.equals(0, counter); | |
| 17 counter++; | |
| 18 return 1; | |
| 19 } | |
| 20 | |
| 21 main() { | |
| 22 a(b()); | |
| 23 Expect.equals(2, counter); | |
| 24 } | |
| OLD | NEW |