OLD | NEW |
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 // VMOptions=--support_find_in_context=true |
| 6 |
5 import "dart:mirrors"; | 7 import "dart:mirrors"; |
6 | 8 |
7 import "stringify.dart"; | 9 import "stringify.dart"; |
8 | 10 |
9 import "package:expect/expect.dart"; | 11 import "package:expect/expect.dart"; |
10 | 12 |
11 import "closure_mirror_import1.dart"; | 13 import "closure_mirror_import1.dart"; |
12 import "closure_mirror_import1.dart" as imp1; | 14 import "closure_mirror_import1.dart" as imp1; |
13 import "closure_mirror_import1.dart" as imp1_hidden | 15 import "closure_mirror_import1.dart" as imp1_hidden |
14 hide globalVariableInImport, StaticClass; | 16 hide globalVariableInImport, StaticClass; |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 expect("Instance(value = 17)", result.apply(const [])); | 64 expect("Instance(value = 17)", result.apply(const [])); |
63 | 65 |
64 result = cm.findInContext(#S.staticInS); | 66 result = cm.findInContext(#S.staticInS); |
65 expect("Instance(value = staticInS)", result); | 67 expect("Instance(value = staticInS)", result); |
66 | 68 |
67 result = cm.findInContext(#staticInS); | 69 result = cm.findInContext(#staticInS); |
68 Expect.isFalse(result is InstanceMirror); | 70 Expect.isFalse(result is InstanceMirror); |
69 Expect.equals(null, result); | 71 Expect.equals(null, result); |
70 | 72 |
71 result = cm.findInContext(#staticFooInS); | 73 result = cm.findInContext(#staticFooInS); |
| 74 Expect.isFalse(result is InstanceMirror); |
| 75 Expect.equals(null, result); |
| 76 |
| 77 result = cm.findInContext(#S.staticFooInS); |
72 Expect.isTrue(result is ClosureMirror); | 78 Expect.isTrue(result is ClosureMirror); |
73 expect("Instance(value = staticFooInS)", result.apply(const [])); | 79 expect("Instance(value = staticFooInS)", result.apply(const [])); |
74 | 80 |
75 result = cm.findInContext(#C.staticFooInS); | 81 result = cm.findInContext(#C.staticFooInS); |
76 Expect.isTrue(result is ClosureMirror); | 82 Expect.isFalse(result is InstanceMirror); |
77 expect("Instance(value = staticFooInS)", result.apply(const [])); | 83 Expect.equals(null, result); |
78 | 84 |
79 result = cm.findInContext(#C.staticInC); | 85 result = cm.findInContext(#C.staticInC); |
80 expect("Instance(value = staticInC)", result); | 86 expect("Instance(value = staticInC)", result); |
81 | 87 |
82 result = cm.findInContext(#staticInC); | 88 result = cm.findInContext(#staticInC); |
83 expect("Instance(value = staticInC)", result); | 89 expect("Instance(value = staticInC)", result); |
84 | 90 |
85 result = cm.findInContext(#C.staticFooInC); | 91 result = cm.findInContext(#C.staticFooInC); |
86 Expect.isTrue(result is ClosureMirror); | 92 Expect.isTrue(result is ClosureMirror); |
87 expect("Instance(value = staticFooInC)", result.apply(const [])); | 93 expect("Instance(value = staticFooInC)", result.apply(const [])); |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 result = c.bar().findInContext(#instanceInC); | 148 result = c.bar().findInContext(#instanceInC); |
143 expect("Instance(value = 11)", result); | 149 expect("Instance(value = 11)", result); |
144 | 150 |
145 result = c.bar().findInContext(#y); | 151 result = c.bar().findInContext(#y); |
146 Expect.isFalse(result is InstanceMirror); | 152 Expect.isFalse(result is InstanceMirror); |
147 Expect.equals(null, result); | 153 Expect.equals(null, result); |
148 | 154 |
149 result = c.baz().findInContext(#instanceInC); | 155 result = c.baz().findInContext(#instanceInC); |
150 expect("Instance(value = <null>)", result); | 156 expect("Instance(value = <null>)", result); |
151 } | 157 } |
OLD | NEW |