| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 // VMOptions=-DUSE_CPS_IR=true | 4 // VMOptions=-DUSE_CPS_IR=true |
| 5 | 5 |
| 6 // Tests of interceptors. | 6 // Tests of interceptors. |
| 7 | 7 |
| 8 library constructor_test; | 8 library constructor_test; |
| 9 | 9 |
| 10 import 'js_backend_cps_ir.dart'; | 10 import 'js_backend_cps_ir.dart'; |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 new Foo(); | 157 new Foo(); |
| 158 } | 158 } |
| 159 """, | 159 """, |
| 160 r""" | 160 r""" |
| 161 function() { | 161 function() { |
| 162 var v0; | 162 var v0; |
| 163 v0 = new V.Foo(); | 163 v0 = new V.Foo(); |
| 164 v0.Bar$5$q$w$y$z("x", null, "w", "y", "z"); | 164 v0.Bar$5$q$w$y$z("x", null, "w", "y", "z"); |
| 165 return v0; | 165 return v0; |
| 166 }"""), | 166 }"""), |
| 167 ]; | 167 const TestEntry(r""" |
| 168 class C<T> { |
| 169 foo() => T; |
| 170 } |
| 171 main() { |
| 172 print(new C<int>().foo()); |
| 173 }""", r""" |
| 174 function() { |
| 175 var v0; |
| 176 v0 = P.$int; |
| 177 P.print(H.setRuntimeTypeInfo(V.C$(), [v0]).foo$0()); |
| 178 return null; |
| 179 }"""), |
| 180 const TestEntry(r""" |
| 181 class C<T> { |
| 182 foo() => C; |
| 183 } |
| 184 main() { |
| 185 print(new C<int>().foo()); |
| 186 }""", r""" |
| 187 function() { |
| 188 P.print(V.C$().foo$0()); |
| 189 return null; |
| 190 }"""), |
| 191 const TestEntry.forMethod('function(C#foo)', r""" |
| 192 class C<T> { |
| 193 foo() => new D<C<T>>(); |
| 194 } |
| 195 class D<T> { |
| 196 bar() => T; |
| 197 } |
| 198 main() { |
| 199 print(new C<int>().foo().bar()); |
| 200 }""", r""" |
| 201 function() { |
| 202 var v0; |
| 203 v0 = [V.C, H.getTypeArgumentByIndex(this, 0)]; |
| 204 return H.setRuntimeTypeInfo(V.D$(), [v0]); |
| 205 }"""), |
| 206 ]; |
| 168 | 207 |
| 169 void main() { | 208 void main() { |
| 170 runTests(tests); | 209 runTests(tests); |
| 171 } | 210 } |
| OLD | NEW |