| 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 'native_testing.dart'; | 5 import 'native_testing.dart'; |
| 6 import 'dart:_js_helper' show 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 on subclasses of native classes. | 9 // Test calling convention on subclasses of native classes. |
| 10 | 10 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 // native class) and (2) realize that the intersection of [B] and subclasses | 25 // native class) and (2) realize that the intersection of [B] and subclasses |
| 26 // of mixin applications of [M] is non-empty. | 26 // of mixin applications of [M] is non-empty. |
| 27 callMiz() => this.miz(); | 27 callMiz() => this.miz(); |
| 28 } | 28 } |
| 29 | 29 |
| 30 B makeB() native; | 30 B makeB() native; |
| 31 | 31 |
| 32 @Creates('=Object') | 32 @Creates('=Object') |
| 33 getBPrototype() native; | 33 getBPrototype() native; |
| 34 | 34 |
| 35 void setup() native r""" | 35 void setup() { |
| 36 function B() {} | 36 JS('', r""" |
| 37 makeB = function(){return new B;}; | 37 (function(){ |
| 38 getBPrototype = function(){return B.prototype;}; | 38 function B() {} |
| 39 """; | 39 makeB = function(){return new B()}; |
| 40 getBPrototype = function(){return B.prototype;}; |
| 41 })()"""); |
| 42 } |
| 40 | 43 |
| 41 main() { | 44 main() { |
| 42 nativeTesting(); | 45 nativeTesting(); |
| 43 setup(); | 46 setup(); |
| 44 | 47 |
| 45 setNativeSubclassDispatchRecord(getBPrototype(), findInterceptorForType(B)); | 48 setNativeSubclassDispatchRecord(getBPrototype(), findInterceptorForType(B)); |
| 46 | 49 |
| 47 B b = makeB(); | 50 B b = makeB(); |
| 48 Expect.equals('M', b.callMiz()); | 51 Expect.equals('M', b.callMiz()); |
| 49 } | 52 } |
| OLD | NEW |