OLD | NEW |
1 // Expectation for test: | 1 // Expectation for test: |
2 // // Method to test: generative_constructor(C#) | 2 // // Method to test: generative_constructor(C#) |
3 // class C<T> { | 3 // class C<T> { |
4 // C() { print(T); } | 4 // C() { print(T); } |
5 // foo() => print(T); | 5 // foo() => print(T); |
6 // } | 6 // } |
7 // main() { | 7 // main() { |
8 // new C<int>(); | 8 // new C<int>(); |
9 // } | 9 // } |
10 | 10 |
11 function($T) { | 11 function($T) { |
12 var v0 = H.setRuntimeTypeInfo(new V.C(), [$T]); | 12 var line = H.S(H.createRuntimeType(H.runtimeTypeToString($T))); |
13 v0.C$0(); | 13 if (typeof dartPrint == "function") |
14 return v0; | 14 dartPrint(line); |
| 15 else if (typeof console == "object" && typeof console.log != "undefined") |
| 16 console.log(line); |
| 17 else if (!(typeof window == "object")) { |
| 18 if (!(typeof print == "function")) |
| 19 throw "Unable to print message: " + String(line); |
| 20 print(line); |
| 21 } |
| 22 return H.setRuntimeTypeInfo(new V.C(), [$T]); |
15 } | 23 } |
OLD | NEW |