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 dart2js.enqueue; | 5 library dart2js.enqueue; |
6 | 6 |
7 import 'dart:collection' show Queue; | 7 import 'dart:collection' show Queue; |
8 | 8 |
9 import 'cache_strategy.dart'; | 9 import 'cache_strategy.dart'; |
10 import 'common/backend_api.dart' show Backend; | 10 import 'common/backend_api.dart' show Backend; |
(...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
342 case TypeUseKind.AS_CAST: | 342 case TypeUseKind.AS_CAST: |
343 case TypeUseKind.CATCH_TYPE: | 343 case TypeUseKind.CATCH_TYPE: |
344 _registerIsCheck(type); | 344 _registerIsCheck(type); |
345 break; | 345 break; |
346 case TypeUseKind.CHECKED_MODE_CHECK: | 346 case TypeUseKind.CHECKED_MODE_CHECK: |
347 if (_options.enableTypeAssertions) { | 347 if (_options.enableTypeAssertions) { |
348 _registerIsCheck(type); | 348 _registerIsCheck(type); |
349 } | 349 } |
350 break; | 350 break; |
351 case TypeUseKind.TYPE_LITERAL: | 351 case TypeUseKind.TYPE_LITERAL: |
| 352 if (type.isTypedef) { |
| 353 universe.openWorld.registerTypedef(type.element); |
| 354 } |
352 break; | 355 break; |
353 } | 356 } |
354 } | 357 } |
355 | 358 |
356 void _registerIsCheck(DartType type) { | 359 void _registerIsCheck(DartType type) { |
357 type = _universe.registerIsCheck(type, _resolution); | 360 type = _universe.registerIsCheck(type, _resolution); |
358 // Even in checked mode, type annotations for return type and argument | 361 // Even in checked mode, type annotations for return type and argument |
359 // types do not imply type checks, so there should never be a check | 362 // types do not imply type checks, so there should never be a check |
360 // against the type variable of a typedef. | 363 // against the type variable of a typedef. |
361 assert(!type.isTypeVariable || !type.element.enclosingElement.isTypedef); | 364 assert(!type.isTypeVariable || !type.element.enclosingElement.isTypedef); |
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
623 } | 626 } |
624 | 627 |
625 typedef void _DeferredActionFunction(); | 628 typedef void _DeferredActionFunction(); |
626 | 629 |
627 class _DeferredAction { | 630 class _DeferredAction { |
628 final Element element; | 631 final Element element; |
629 final _DeferredActionFunction action; | 632 final _DeferredActionFunction action; |
630 | 633 |
631 _DeferredAction(this.element, this.action); | 634 _DeferredAction(this.element, this.action); |
632 } | 635 } |
OLD | NEW |