| 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 deferred_load; | 5 library deferred_load; |
| 6 | 6 |
| 7 import 'dart2jslib.dart' show | 7 import 'dart2jslib.dart' show |
| 8 Backend, | 8 Backend, |
| 9 Compiler, | 9 Compiler, |
| 10 CompilerTask, | 10 CompilerTask, |
| (...skipping 745 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 756 } | 756 } |
| 757 } | 757 } |
| 758 }); | 758 }); |
| 759 } | 759 } |
| 760 Backend backend = compiler.backend; | 760 Backend backend = compiler.backend; |
| 761 if (splitProgram && backend is JavaScriptBackend) { | 761 if (splitProgram && backend is JavaScriptBackend) { |
| 762 backend.registerCheckDeferredIsLoaded(compiler.globalDependencies); | 762 backend.registerCheckDeferredIsLoaded(compiler.globalDependencies); |
| 763 } | 763 } |
| 764 if (splitProgram && backend is DartBackend) { | 764 if (splitProgram && backend is DartBackend) { |
| 765 // TODO(sigurdm): Implement deferred loading for dart2dart. | 765 // TODO(sigurdm): Implement deferred loading for dart2dart. |
| 766 compiler.reportFatalError( | 766 compiler.reportWarning( |
| 767 lastDeferred, | 767 lastDeferred, |
| 768 MessageKind.DEFERRED_LIBRARY_DART_2_DART); | 768 MessageKind.DEFERRED_LIBRARY_DART_2_DART); |
| 769 splitProgram = false; |
| 769 } | 770 } |
| 770 } | 771 } |
| 771 | 772 |
| 772 /// If [send] is a static send with a deferred element, returns the | 773 /// If [send] is a static send with a deferred element, returns the |
| 773 /// [PrefixElement] that the first prefix of the send resolves to. | 774 /// [PrefixElement] that the first prefix of the send resolves to. |
| 774 /// Otherwise returns null. | 775 /// Otherwise returns null. |
| 775 /// | 776 /// |
| 776 /// Precondition: send must be static. | 777 /// Precondition: send must be static. |
| 777 /// | 778 /// |
| 778 /// Example: | 779 /// Example: |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 818 Element maybePrefix = elements[identifier]; | 819 Element maybePrefix = elements[identifier]; |
| 819 if (maybePrefix != null && maybePrefix.isPrefix) { | 820 if (maybePrefix != null && maybePrefix.isPrefix) { |
| 820 PrefixElement prefixElement = maybePrefix; | 821 PrefixElement prefixElement = maybePrefix; |
| 821 if (prefixElement.isDeferred) { | 822 if (prefixElement.isDeferred) { |
| 822 return prefixElement; | 823 return prefixElement; |
| 823 } | 824 } |
| 824 } | 825 } |
| 825 return null; | 826 return null; |
| 826 } | 827 } |
| 827 } | 828 } |
| OLD | NEW |