OLD | NEW |
(Empty) | |
| 1 library; |
| 2 import self as self; |
| 3 import "dart:core" as core; |
| 4 |
| 5 class B extends core::Object { |
| 6 field core::num x; |
| 7 field core::String y; |
| 8 constructor •(core::num x, core::String y) → void |
| 9 : self::B::x = x, self::B::y = y, super core::Object::•() { |
| 10 self::events = self::events.{core::String::+}("super(${this.{self::B::x}}, $
{this.{self::B::y}})\n"); |
| 11 } |
| 12 } |
| 13 class C extends self::B { |
| 14 final field dynamic z; |
| 15 constructor •() → void |
| 16 : final core::int #t1 = self::f(1), final core::String #t2 = self::g(2), sel
f::C::z = self::f(3), super self::B::•(#t1, #t2) |
| 17 ; |
| 18 } |
| 19 static field core::String events = ""; |
| 20 static method f(dynamic x) → core::int { |
| 21 self::events = self::events.{core::String::+}("f(${x})\n"); |
| 22 return 0; |
| 23 } |
| 24 static method g(dynamic x) → core::String { |
| 25 self::events = self::events.{core::String::+}("g(${x})\n"); |
| 26 return "foo"; |
| 27 } |
| 28 static method main() → dynamic { |
| 29 new self::C::•(); |
| 30 if(!self::events.{core::String::==}("f(1)\ng(2)\nf(3)\nsuper(0, foo)\n")) { |
| 31 throw "Unexpected sequence of events: ${self::events}"; |
| 32 } |
| 33 } |
OLD | NEW |