OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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('dart:_js_helper'); | 5 #library('dart:_js_helper'); |
6 | 6 |
7 #import('dart:coreimpl'); | 7 #import('dart:coreimpl'); |
8 #import('dart:collection'); | 8 #import('dart:collection'); |
9 | 9 |
10 #source('constant_map.dart'); | 10 #source('constant_map.dart'); |
(...skipping 1369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1380 if (JS('bool', '#[#]()', value, property)) return value; | 1380 if (JS('bool', '#[#]()', value, property)) return value; |
1381 propertyTypeError(value, property); | 1381 propertyTypeError(value, property); |
1382 } | 1382 } |
1383 | 1383 |
1384 listSuperNativeTypeCast(value, property) { | 1384 listSuperNativeTypeCast(value, property) { |
1385 if (value is List || value == null) return value; | 1385 if (value is List || value == null) return value; |
1386 if (JS('bool', '#[#]()', value, property)) return value; | 1386 if (JS('bool', '#[#]()', value, property)) return value; |
1387 propertyTypeCastError(value, property); | 1387 propertyTypeCastError(value, property); |
1388 } | 1388 } |
1389 | 1389 |
| 1390 voidTypeCheck(value) { |
| 1391 if (value == null) return value; |
| 1392 throw new TypeErrorImplementation(value, 'void'); |
| 1393 } |
| 1394 |
1390 /** | 1395 /** |
1391 * Special interface recognized by the compiler and implemented by DOM | 1396 * Special interface recognized by the compiler and implemented by DOM |
1392 * objects that support integer indexing. This interface is not | 1397 * objects that support integer indexing. This interface is not |
1393 * visible to anyone, and is only injected into special libraries. | 1398 * visible to anyone, and is only injected into special libraries. |
1394 */ | 1399 */ |
1395 abstract class JavaScriptIndexingBehavior { | 1400 abstract class JavaScriptIndexingBehavior { |
1396 } | 1401 } |
1397 | 1402 |
1398 // TODO(lrn): These exceptions should be implemented in core. | 1403 // TODO(lrn): These exceptions should be implemented in core. |
1399 // When they are, remove the 'Implementation' here. | 1404 // When they are, remove the 'Implementation' here. |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1472 result = new TypeImpl(key); | 1477 result = new TypeImpl(key); |
1473 JS('var', r'#[#] = #', runtimeTypeCache, key, result); | 1478 JS('var', r'#[#] = #', runtimeTypeCache, key, result); |
1474 } | 1479 } |
1475 return result; | 1480 return result; |
1476 } | 1481 } |
1477 | 1482 |
1478 String getRuntimeTypeString(var object) { | 1483 String getRuntimeTypeString(var object) { |
1479 var typeInfo = JS('Object', r'#.builtin$typeInfo', object); | 1484 var typeInfo = JS('Object', r'#.builtin$typeInfo', object); |
1480 return JS('String', r'#.runtimeType', typeInfo); | 1485 return JS('String', r'#.runtimeType', typeInfo); |
1481 } | 1486 } |
OLD | NEW |