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 library _js_helper; | 5 library _js_helper; |
6 | 6 |
7 import 'dart:_js_embedded_names' | 7 import 'dart:_js_embedded_names' |
8 show | 8 show |
9 DEFERRED_LIBRARY_URIS, | 9 DEFERRED_LIBRARY_URIS, |
10 DEFERRED_LIBRARY_HASHES, | 10 DEFERRED_LIBRARY_HASHES, |
(...skipping 3397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3408 if (JS('bool', '#[#]', getInterceptor(value), property)) return value; | 3408 if (JS('bool', '#[#]', getInterceptor(value), property)) return value; |
3409 propertyTypeError(value, property); | 3409 propertyTypeError(value, property); |
3410 } | 3410 } |
3411 | 3411 |
3412 listSuperNativeTypeCast(value, property) { | 3412 listSuperNativeTypeCast(value, property) { |
3413 if (value is List || value == null) return value; | 3413 if (value is List || value == null) return value; |
3414 if (JS('bool', '#[#]', getInterceptor(value), property)) return value; | 3414 if (JS('bool', '#[#]', getInterceptor(value), property)) return value; |
3415 propertyTypeCastError(value, property); | 3415 propertyTypeCastError(value, property); |
3416 } | 3416 } |
3417 | 3417 |
| 3418 voidTypeCheck(value) { |
| 3419 if (value == null) return value; |
| 3420 throw new TypeErrorImplementation(value, 'void'); |
| 3421 } |
| 3422 |
3418 extractFunctionTypeObjectFrom(o) { | 3423 extractFunctionTypeObjectFrom(o) { |
3419 var interceptor = getInterceptor(o); | 3424 var interceptor = getInterceptor(o); |
3420 var signatureName = JS_GET_NAME(JsGetName.SIGNATURE_NAME); | 3425 var signatureName = JS_GET_NAME(JsGetName.SIGNATURE_NAME); |
3421 return JS('bool', '# in #', signatureName, interceptor) | 3426 return JS('bool', '# in #', signatureName, interceptor) |
3422 ? JS('', '#[#]()', interceptor, signatureName) | 3427 ? JS('', '#[#]()', interceptor, signatureName) |
3423 : null; | 3428 : null; |
3424 } | 3429 } |
3425 | 3430 |
3426 functionTypeTest(value, functionTypeRti) { | 3431 functionTypeTest(value, functionTypeRti) { |
3427 if (value == null) return false; | 3432 if (value == null) return false; |
(...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3795 // unneeded code. | 3800 // unneeded code. |
3796 class _UnreachableError extends AssertionError { | 3801 class _UnreachableError extends AssertionError { |
3797 _UnreachableError(); | 3802 _UnreachableError(); |
3798 String toString() => "Assertion failed: Reached dead code"; | 3803 String toString() => "Assertion failed: Reached dead code"; |
3799 } | 3804 } |
3800 | 3805 |
3801 @NoInline() | 3806 @NoInline() |
3802 void assertUnreachable() { | 3807 void assertUnreachable() { |
3803 throw new _UnreachableError(); | 3808 throw new _UnreachableError(); |
3804 } | 3809 } |
OLD | NEW |