OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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.serialization_helper; | 5 library dart2js.serialization_helper; |
6 | 6 |
7 import 'dart:io'; | 7 import 'dart:io'; |
8 import 'dart:async'; | 8 import 'dart:async'; |
9 import 'package:async_helper/async_helper.dart'; | 9 import 'package:async_helper/async_helper.dart'; |
10 import 'package:expect/expect.dart'; | 10 import 'package:expect/expect.dart'; |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 } | 225 } |
226 | 226 |
227 @override | 227 @override |
228 ResolutionImpact getResolutionImpact(Element element) { | 228 ResolutionImpact getResolutionImpact(Element element) { |
229 return _resolutionImpactDeserializer.impactMap[element]; | 229 return _resolutionImpactDeserializer.impactMap[element]; |
230 } | 230 } |
231 | 231 |
232 @override | 232 @override |
233 WorldImpact computeWorldImpact(Element element) { | 233 WorldImpact computeWorldImpact(Element element) { |
234 ResolutionImpact resolutionImpact = getResolutionImpact(element); | 234 ResolutionImpact resolutionImpact = getResolutionImpact(element); |
235 if (resolutionImpact == null) { | 235 assert(invariant(element, resolutionImpact != null, |
236 print('No impact found for $element (${element.library})'); | 236 message: 'No impact found for $element (${element.library})')); |
237 return const WorldImpact(); | 237 return _impactTransformer.transformResolutionImpact(resolutionImpact); |
238 } else { | |
239 return _impactTransformer.transformResolutionImpact(resolutionImpact); | |
240 } | |
241 } | 238 } |
242 | 239 |
243 @override | 240 @override |
244 bool isDeserialized(Element element) { | 241 bool isDeserialized(Element element) { |
245 return deserializedLibraries.contains(element.library); | 242 return deserializedLibraries.contains(element.library); |
246 } | 243 } |
247 } | 244 } |
248 | 245 |
249 const String RESOLVED_AST_TAG = 'resolvedAst'; | 246 const String RESOLVED_AST_TAG = 'resolvedAst'; |
250 | 247 |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
310 | 307 |
311 @override | 308 @override |
312 void onElement(Element element, ObjectDecoder getDecoder(String tag)) { | 309 void onElement(Element element, ObjectDecoder getDecoder(String tag)) { |
313 ObjectDecoder decoder = getDecoder(RESOLVED_AST_TAG); | 310 ObjectDecoder decoder = getDecoder(RESOLVED_AST_TAG); |
314 if (decoder != null) { | 311 if (decoder != null) { |
315 _decoderMap[element] = decoder; | 312 _decoderMap[element] = decoder; |
316 } | 313 } |
317 } | 314 } |
318 } | 315 } |
319 | 316 |
OLD | NEW |