| 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 type checks. | 9 // Test type checks. |
| 10 | 10 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 T z = x; | 27 T z = x; |
| 28 Expect.identical(x, z); | 28 Expect.identical(x, z); |
| 29 } | 29 } |
| 30 | 30 |
| 31 void castCheck(x) { | 31 void castCheck(x) { |
| 32 var z = x as T; | 32 var z = x as T; |
| 33 Expect.identical(x, z); | 33 Expect.identical(x, z); |
| 34 } | 34 } |
| 35 } | 35 } |
| 36 | 36 |
| 37 makeB() native ; | 37 makeB() native; |
| 38 | 38 |
| 39 @Creates('=Object') | 39 @Creates('=Object') |
| 40 getBPrototype() native ; | 40 getBPrototype() native; |
| 41 | 41 |
| 42 void setup() native r""" | 42 void setup() native r""" |
| 43 function B() {} | 43 function B() {} |
| 44 makeB = function(){return new B;}; | 44 makeB = function(){return new B;}; |
| 45 getBPrototype = function(){return B.prototype;}; | 45 getBPrototype = function(){return B.prototype;}; |
| 46 """; | 46 """; |
| 47 | 47 |
| 48 bool isCheckedMode() { | 48 bool isCheckedMode() { |
| 49 var isChecked = false; | 49 var isChecked = false; |
| 50 assert(isChecked = true); | 50 assert(isChecked = true); |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 confuse(new Checks<M>().assignCheck)(b); | 160 confuse(new Checks<M>().assignCheck)(b); |
| 161 confuse(new Checks<I>().assignCheck)(b); | 161 confuse(new Checks<I>().assignCheck)(b); |
| 162 | 162 |
| 163 confuse(new Checks<B>().castCheck)(b); | 163 confuse(new Checks<B>().castCheck)(b); |
| 164 confuse(new Checks<A>().castCheck)(b); | 164 confuse(new Checks<A>().castCheck)(b); |
| 165 confuse(new Checks<N>().castCheck)(b); | 165 confuse(new Checks<N>().castCheck)(b); |
| 166 confuse(new Checks<M>().castCheck)(b); | 166 confuse(new Checks<M>().castCheck)(b); |
| 167 confuse(new Checks<I>().castCheck)(b); | 167 confuse(new Checks<I>().castCheck)(b); |
| 168 } | 168 } |
| 169 } | 169 } |
| OLD | NEW |