| 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 21 matching lines...) Expand all Loading... |
| 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() { |
| 43 function B() {} | 43 JS('', r""" |
| 44 makeB = function(){return new B;}; | 44 (function(){ |
| 45 getBPrototype = function(){return B.prototype;}; | 45 function B() {} |
| 46 """; | 46 makeB = function(){return new B()}; |
| 47 getBPrototype = function(){return B.prototype;}; |
| 48 })()"""); |
| 49 } |
| 47 | 50 |
| 48 bool isCheckedMode() { | 51 bool isCheckedMode() { |
| 49 var isChecked = false; | 52 var isChecked = false; |
| 50 assert(isChecked = true); | 53 assert(isChecked = true); |
| 51 return isChecked; | 54 return isChecked; |
| 52 } | 55 } |
| 53 | 56 |
| 54 testIsI(x) { | 57 testIsI(x) { |
| 55 Expect.isTrue(x is I); | 58 Expect.isTrue(x is I); |
| 56 } | 59 } |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 confuse(new Checks<M>().assignCheck)(b); | 163 confuse(new Checks<M>().assignCheck)(b); |
| 161 confuse(new Checks<I>().assignCheck)(b); | 164 confuse(new Checks<I>().assignCheck)(b); |
| 162 | 165 |
| 163 confuse(new Checks<B>().castCheck)(b); | 166 confuse(new Checks<B>().castCheck)(b); |
| 164 confuse(new Checks<A>().castCheck)(b); | 167 confuse(new Checks<A>().castCheck)(b); |
| 165 confuse(new Checks<N>().castCheck)(b); | 168 confuse(new Checks<N>().castCheck)(b); |
| 166 confuse(new Checks<M>().castCheck)(b); | 169 confuse(new Checks<M>().castCheck)(b); |
| 167 confuse(new Checks<I>().castCheck)(b); | 170 confuse(new Checks<I>().castCheck)(b); |
| 168 } | 171 } |
| 169 } | 172 } |
| OLD | NEW |