| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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_incremental.library_updater; | 5 library dart2js_incremental.library_updater; |
| 6 | 6 |
| 7 import 'dart:async' show | 7 import 'dart:async' show |
| 8 Future; | 8 Future; |
| 9 | 9 |
| 10 import 'dart:convert' show | 10 import 'dart:convert' show |
| (...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 342 bool unableToReuse( | 342 bool unableToReuse( |
| 343 Token diffToken, | 343 Token diffToken, |
| 344 PartialElement before, | 344 PartialElement before, |
| 345 PartialElement after) { | 345 PartialElement after) { |
| 346 return cannotReuse( | 346 return cannotReuse( |
| 347 after, | 347 after, |
| 348 'Unhandled change:' | 348 'Unhandled change:' |
| 349 ' ${before} (${before.runtimeType} -> ${after.runtimeType}).'); | 349 ' ${before} (${before.runtimeType} -> ${after.runtimeType}).'); |
| 350 } | 350 } |
| 351 | 351 |
| 352 /// Apply the collected [updates]. Return a list of elements that needs to be |
| 353 /// recompiled after applying the updates. Any elements removed as a |
| 354 /// consequence of applying the patches are added to [removals] if provided. |
| 352 List<Element> applyUpdates([List<Update> removals]) { | 355 List<Element> applyUpdates([List<Update> removals]) { |
| 353 for (Update update in updates) { | 356 for (Update update in updates) { |
| 354 update.captureState(); | 357 update.captureState(); |
| 355 } | 358 } |
| 356 if (!_failedUpdates.isEmpty) { | 359 if (!_failedUpdates.isEmpty) { |
| 357 throw new StateError( | 360 throw new StateError( |
| 358 "Can't compute update.\n\n${_failedUpdates.join('\n\n')}"); | 361 "Can't compute update.\n\n${_failedUpdates.join('\n\n')}"); |
| 359 } | 362 } |
| 360 for (ElementX element in _elementsToInvalidate) { | 363 for (ElementX element in _elementsToInvalidate) { |
| 361 compiler.forgetElement(element); | 364 compiler.forgetElement(element); |
| (...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 744 | 747 |
| 745 abstract class JsFeatures { | 748 abstract class JsFeatures { |
| 746 Compiler get compiler; | 749 Compiler get compiler; |
| 747 | 750 |
| 748 JavaScriptBackend get backend => compiler.backend; | 751 JavaScriptBackend get backend => compiler.backend; |
| 749 | 752 |
| 750 Namer get namer => backend.namer; | 753 Namer get namer => backend.namer; |
| 751 | 754 |
| 752 CodeEmitterTask get emitter => backend.emitter; | 755 CodeEmitterTask get emitter => backend.emitter; |
| 753 } | 756 } |
| OLD | NEW |