| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 import "package:expect/expect.dart"; | 5 import 'native_testing.dart'; |
| 6 import 'dart:_js_helper' show Native, Creates, setNativeSubclassDispatchRecord; | 6 import 'dart:_js_helper' show setNativeSubclassDispatchRecord; |
| 7 import 'dart:_interceptors' show Interceptor, findInterceptorForType; | 7 import 'dart:_interceptors' show Interceptor, findInterceptorForType; |
| 8 | 8 |
| 9 // Test calling convention of methods introduced on subclasses of native | 9 // Test calling convention of methods introduced on subclasses of native |
| 10 // class of mixin. | 10 // class of mixin. |
| 11 | 11 |
| 12 doFoo(r, x) => '$x,${r.oof()},${r.miz()}'; | 12 doFoo(r, x) => '$x,${r.oof()},${r.miz()}'; |
| 13 | 13 |
| 14 class M { | 14 class M { |
| 15 miz() => 'M'; | 15 miz() => 'M'; |
| 16 } | 16 } |
| (...skipping 18 matching lines...) Expand all Loading... |
| 35 getBPrototype() native ; | 35 getBPrototype() native ; |
| 36 | 36 |
| 37 void setup() native r""" | 37 void setup() native r""" |
| 38 function B() {} | 38 function B() {} |
| 39 makeB = function(){return new B;}; | 39 makeB = function(){return new B;}; |
| 40 | 40 |
| 41 getBPrototype = function(){return B.prototype;}; | 41 getBPrototype = function(){return B.prototype;}; |
| 42 """; | 42 """; |
| 43 | 43 |
| 44 main() { | 44 main() { |
| 45 nativeTesting(); |
| 45 setup(); | 46 setup(); |
| 46 | 47 |
| 47 setNativeSubclassDispatchRecord(getBPrototype(), findInterceptorForType(B)); | 48 setNativeSubclassDispatchRecord(getBPrototype(), findInterceptorForType(B)); |
| 48 | 49 |
| 49 B b = makeB(); | 50 B b = makeB(); |
| 50 Expect.equals('1,B,M', b.foo(1)); | 51 Expect.equals('1,B,M', b.foo(1)); |
| 51 } | 52 } |
| OLD | NEW |