| 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.js.enqueue; | 5 library dart2js.js.enqueue; |
| 6 | 6 |
| 7 import 'dart:collection' show Queue; | 7 import 'dart:collection' show Queue; |
| 8 | 8 |
| 9 import '../common/codegen.dart' show CodegenWorkItem; | 9 import '../common/codegen.dart' show CodegenWorkItem; |
| 10 import '../common/tasks.dart' show CompilerTask; | 10 import '../common/tasks.dart' show CompilerTask; |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 if (_options.enableTypeAssertions) { | 195 if (_options.enableTypeAssertions) { |
| 196 _registerIsCheck(type); | 196 _registerIsCheck(type); |
| 197 } | 197 } |
| 198 break; | 198 break; |
| 199 case TypeUseKind.TYPE_LITERAL: | 199 case TypeUseKind.TYPE_LITERAL: |
| 200 break; | 200 break; |
| 201 } | 201 } |
| 202 } | 202 } |
| 203 | 203 |
| 204 void _registerIsCheck(ResolutionDartType type) { | 204 void _registerIsCheck(ResolutionDartType type) { |
| 205 type = _universe.registerIsCheck(type); | 205 _universe.registerIsCheck(type); |
| 206 // Even in checked mode, type annotations for return type and argument | |
| 207 // types do not imply type checks, so there should never be a check | |
| 208 // against the type variable of a typedef. | |
| 209 assert(!type.isTypeVariable || !type.element.enclosingElement.isTypedef); | |
| 210 } | 206 } |
| 211 | 207 |
| 212 void _registerClosurizedMember(MemberElement element) { | 208 void _registerClosurizedMember(MemberElement element) { |
| 213 assert(element.isInstanceMember); | 209 assert(element.isInstanceMember); |
| 214 applyImpact(listener.registerClosurizedMember(element)); | 210 applyImpact(listener.registerClosurizedMember(element)); |
| 215 } | 211 } |
| 216 | 212 |
| 217 void forEach(void f(WorkItem work)) { | 213 void forEach(void f(WorkItem work)) { |
| 218 do { | 214 do { |
| 219 while (_queue.isNotEmpty) { | 215 while (_queue.isNotEmpty) { |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 // code for checked setters. | 273 // code for checked setters. |
| 278 if (element.isField && element.isInstanceMember) { | 274 if (element.isField && element.isInstanceMember) { |
| 279 if (!_options.enableTypeAssertions || | 275 if (!_options.enableTypeAssertions || |
| 280 element.enclosingElement.isClosure) { | 276 element.enclosingElement.isClosure) { |
| 281 return null; | 277 return null; |
| 282 } | 278 } |
| 283 } | 279 } |
| 284 return new CodegenWorkItem(_backend, element); | 280 return new CodegenWorkItem(_backend, element); |
| 285 } | 281 } |
| 286 } | 282 } |
| OLD | NEW |