Index: tests/lib/mirrors/proxy_type_test.dart |
diff --git a/tests/lib/mirrors/proxy_type_test.dart b/tests/lib/mirrors/proxy_type_test.dart |
index acc74db4653f4433b4502455dbb43a357134ea8f..358fe59ed05e85127e925c10ea4229f1faf536b6 100644 |
--- a/tests/lib/mirrors/proxy_type_test.dart |
+++ b/tests/lib/mirrors/proxy_type_test.dart |
@@ -20,12 +20,14 @@ class Alice { |
sayFooUnattenuated() { |
bob.foo(carol); |
} |
+ |
sayFooAttenuated() { |
bool enabled = true; |
bool gate() => enabled; |
bob.foo(new CarolCaretaker(carol, gate)); |
- enabled = false; // Attenuate a capability |
+ enabled = false; // Attenuate a capability |
} |
+ |
sayBar() { |
bob.bar(); |
} |
@@ -34,9 +36,10 @@ class Alice { |
class Bob { |
Carol savedCarol; |
foo(Carol carol) { |
- savedCarol = carol; // Store a capability |
+ savedCarol = carol; // Store a capability |
carol.foo(); |
} |
+ |
bar() { |
savedCarol.foo(); |
} |
@@ -64,20 +67,18 @@ class CarolCaretaker implements Carol { |
main() { |
Alice alice1 = new Alice(); |
alice1.sayFooUnattenuated(); |
- alice1.sayBar(); // Bob still has authority to use Carol |
+ alice1.sayBar(); // Bob still has authority to use Carol |
Alice alice2 = new Alice(); |
alice2.sayFooAttenuated(); |
- Expect.throws(() => alice2.sayBar(), |
- (e) => e is NoSuchMethodError, |
- 'Authority should have been attenuated'); |
+ Expect.throws(() => alice2.sayBar(), (e) => e is NoSuchMethodError, |
+ 'Authority should have been attenuated'); |
// At the base level, a caretaker for a Carol masquerades as a Carol. |
- CarolCaretaker caretaker = new CarolCaretaker(new Carol(), ()=>true); |
+ CarolCaretaker caretaker = new CarolCaretaker(new Carol(), () => true); |
Expect.isTrue(caretaker is Carol); |
Expect.equals(Carol, caretaker.runtimeType); |
// At the reflective level, the caretaker is distinguishable. |
- Expect.equals(reflectClass(CarolCaretaker), |
- reflect(caretaker).type); |
+ Expect.equals(reflectClass(CarolCaretaker), reflect(caretaker).type); |
} |