OLD | NEW |
| (Empty) |
1 library; | |
2 import self as self; | |
3 import "dart:core" as core; | |
4 | |
5 static method foo({dynamic fisk = null}) → dynamic { | |
6 core::print(fisk); | |
7 } | |
8 static method caller(dynamic f) → dynamic { | |
9 f.call(); | |
10 } | |
11 static method main() → dynamic { | |
12 core::int i = 0; | |
13 core::print(i.==(1) ? "bad" : "good"); | |
14 core::print("${i}"); | |
15 core::print("'${i}'"); | |
16 core::print(" '${i}' "); | |
17 core::print(" '${i}' '${i}'"); | |
18 core::print(" '${i}' '${i}'"); | |
19 core::print("foobar"); | |
20 core::print(" '${i}' '${i}' '${i}' '${i}'"); | |
21 try { | |
22 throw "fisk"; | |
23 } | |
24 on core::String catch(final dynamic e, final dynamic s) { | |
25 core::print(e); | |
26 if(!s.==(null)) | |
27 core::print(s); | |
28 } | |
29 for (; false; ) { | |
30 } | |
31 dynamic list = <dynamic>["Hello, World!"]; | |
32 core::print(list.[](i)); | |
33 list.[]=(i, "Hello, Brave New World!"); | |
34 core::print(list.[](i)); | |
35 i = 87; | |
36 core::print(i.unary-()); | |
37 core::print(i.~()); | |
38 core::print(!i.==(42)); | |
39 core::print(i = i.-(1)); | |
40 core::print(i = i.+(1)); | |
41 core::print(let final dynamic #t1 = i in let final dynamic #t2 = i = #t1.-(1)
in #t1); | |
42 core::print(let final dynamic #t3 = i in let final dynamic #t4 = i = #t3.+(1)
in #t3); | |
43 core::print(new core::Object::•()); | |
44 core::print(const core::Object::•()); | |
45 core::print(core::List::_internal<core::String>(2).runtimeType); | |
46 self::foo(fisk: "Blorp gulp"); | |
47 function f() → dynamic { | |
48 core::print("f was called"); | |
49 } | |
50 self::caller(f); | |
51 self::caller(() → dynamic { | |
52 core::print("<anon> was called"); | |
53 }); | |
54 function g([dynamic message]) → dynamic { | |
55 core::print(message); | |
56 } | |
57 g.call("Hello, World"); | |
58 self::caller(([dynamic x]) → dynamic { | |
59 core::print("<anon> was called with ${x}"); | |
60 }); | |
61 function h({dynamic message}) → dynamic { | |
62 core::print(message); | |
63 } | |
64 h.call(message: "Hello, World"); | |
65 self::caller(({dynamic x}) → dynamic { | |
66 core::print("<anon> was called with ${x}"); | |
67 }); | |
68 core::print(core::int.toString()); | |
69 core::print(core::int); | |
70 core::print(let final dynamic #t5 = core::int in let final dynamic #t6 = #t5.t
oString() in #t5); | |
71 try { | |
72 core::print(throw new core::NoSuchMethodError::•(null, #toString, <dynamic>[
], <dynamic, dynamic>{}, null)); | |
73 throw "Shouldn't work"; | |
74 } | |
75 on core::NoSuchMethodError catch(final dynamic e) { | |
76 core::print("As expected: ${e}"); | |
77 } | |
78 core::print(core::int::parse("42")); | |
79 } | |
OLD | NEW |