| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 | 4 |
| 5 // Tests of interceptors. | 5 // Tests of interceptors. |
| 6 | 6 |
| 7 library supercall_test; | 7 library supercall_test; |
| 8 | 8 |
| 9 import 'js_backend_cps_ir.dart'; | 9 import 'js_backend_cps_ir.dart'; |
| 10 | 10 |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 // function(x) { | 46 // function(x) { |
| 47 // var v0, v1, v2; | 47 // var v0, v1, v2; |
| 48 // v0 = 1; | 48 // v0 = 1; |
| 49 // v1 = J.getInterceptor$ns(x).$add(x, v0); | 49 // v1 = J.getInterceptor$ns(x).$add(x, v0); |
| 50 // v2 = this; | 50 // v2 = this; |
| 51 // return V.Base.prototype.$add.call(null, v2, v1); | 51 // return V.Base.prototype.$add.call(null, v2, v1); |
| 52 // }"""), | 52 // }"""), |
| 53 | 53 |
| 54 const TestEntry.forMethod('function(Sub#m)', """ | 54 const TestEntry.forMethod('function(Sub#m)', """ |
| 55 class Base { | 55 class Base { |
| 56 var field; | 56 var field = 123; |
| 57 } | 57 } |
| 58 class Sub extends Base { | 58 class Sub extends Base { |
| 59 m(x) => x + super.field; | 59 m(x) => x + super.field; |
| 60 } | 60 } |
| 61 main() { | 61 main() { |
| 62 print(new Sub().m(10)); | 62 print(new Sub().m(10)); |
| 63 }""", | 63 }""", |
| 64 r""" | 64 r""" |
| 65 function(x) { | 65 function(x) { |
| 66 return J.getInterceptor$ns(x).$add(x, this.field); | 66 return x + this.field; |
| 67 }"""), | 67 }"""), |
| 68 | 68 |
| 69 | 69 |
| 70 ]; | 70 ]; |
| 71 | 71 |
| 72 void main() { | 72 void main() { |
| 73 runTests(tests); | 73 runTests(tests); |
| 74 } | 74 } |
| OLD | NEW |