| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 library test.local_function_is_static; | 5 library test.local_function_is_static; |
| 6 | 6 |
| 7 @MirrorsUsed(targets: "test.local_function_is_static") |
| 7 import 'dart:mirrors'; | 8 import 'dart:mirrors'; |
| 8 import 'package:expect/expect.dart'; | 9 import 'package:expect/expect.dart'; |
| 9 | 10 |
| 10 topLevel() => 1; | 11 topLevel() => 1; |
| 11 topLevelLocal() => () => 2; | 12 topLevelLocal() => () => 2; |
| 12 class C { | 13 class C { |
| 13 static klass() => 3; | 14 static klass() => 3; |
| 14 static klassLocal() => () => 4; | 15 static klassLocal() => () => 4; |
| 15 instance() => 5; | 16 instance() => 5; |
| 16 instanceLocal() => () => 6; | 17 instanceLocal() => () => 6; |
| (...skipping 17 matching lines...) Expand all Loading... |
| 34 Expect.isTrue((reflect(f) as ClosureMirror).function.isStatic); | 35 Expect.isTrue((reflect(f) as ClosureMirror).function.isStatic); |
| 35 | 36 |
| 36 f = new C().instance; | 37 f = new C().instance; |
| 37 Expect.equals(5, f()); | 38 Expect.equals(5, f()); |
| 38 Expect.isFalse((reflect(f) as ClosureMirror).function.isStatic); | 39 Expect.isFalse((reflect(f) as ClosureMirror).function.isStatic); |
| 39 | 40 |
| 40 f = new C().instanceLocal(); | 41 f = new C().instanceLocal(); |
| 41 Expect.equals(6, f()); | 42 Expect.equals(6, f()); |
| 42 Expect.isFalse((reflect(f) as ClosureMirror).function.isStatic); | 43 Expect.isFalse((reflect(f) as ClosureMirror).function.isStatic); |
| 43 } | 44 } |
| OLD | NEW |