Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(326)

Side by Side Diff: pkg/compiler/lib/src/compiler.dart

Issue 2791993002: Fix dart2js warnings and add test to ensure it stays clean. (Closed)
Patch Set: Address comments and fix duplicated library names. Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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.compiler_base; 5 library dart2js.compiler_base;
6 6
7 import 'dart:async' show EventSink, Future; 7 import 'dart:async' show Future;
8 8
9 import '../compiler_new.dart' as api; 9 import '../compiler_new.dart' as api;
10 import 'closure.dart' as closureMapping show ClosureTask; 10 import 'closure.dart' as closureMapping show ClosureTask;
11 import 'common/names.dart' show Selectors; 11 import 'common/names.dart' show Selectors;
12 import 'common/names.dart' show Identifiers, Uris; 12 import 'common/names.dart' show Identifiers, Uris;
13 import 'common/resolution.dart' 13 import 'common/resolution.dart'
14 show 14 show
15 ParsingContext, 15 ParsingContext,
16 Resolution, 16 Resolution,
17 ResolutionWorkItem, 17 ResolutionWorkItem,
(...skipping 14 matching lines...) Expand all
32 import 'dump_info.dart' show DumpInfoTask; 32 import 'dump_info.dart' show DumpInfoTask;
33 import 'elements/elements.dart'; 33 import 'elements/elements.dart';
34 import 'elements/entities.dart'; 34 import 'elements/entities.dart';
35 import 'elements/modelx.dart' show ErroneousElementX; 35 import 'elements/modelx.dart' show ErroneousElementX;
36 import 'elements/resolution_types.dart' 36 import 'elements/resolution_types.dart'
37 show 37 show
38 ResolutionDartType, 38 ResolutionDartType,
39 ResolutionDynamicType, 39 ResolutionDynamicType,
40 ResolutionInterfaceType, 40 ResolutionInterfaceType,
41 Types; 41 Types;
42 import 'enqueue.dart' 42 import 'enqueue.dart' show Enqueuer, EnqueueTask, ResolutionEnqueuer;
43 show DeferredAction, Enqueuer, EnqueueTask, ResolutionEnqueuer;
44 import 'environment.dart'; 43 import 'environment.dart';
45 import 'id_generator.dart'; 44 import 'id_generator.dart';
46 import 'io/source_information.dart' show SourceInformation; 45 import 'io/source_information.dart' show SourceInformation;
47 import 'js_backend/backend.dart' show JavaScriptBackend; 46 import 'js_backend/backend.dart' show JavaScriptBackend;
48 import 'library_loader.dart' 47 import 'library_loader.dart'
49 show 48 show
50 ElementScanner, 49 ElementScanner,
51 LibraryLoader, 50 LibraryLoader,
52 LibraryLoaderTask, 51 LibraryLoaderTask,
53 LoadedLibraries, 52 LoadedLibraries,
(...skipping 1725 matching lines...) Expand 10 before | Expand all | Expand 10 after
1779 compiler.readScript(uri, spannable); 1778 compiler.readScript(uri, spannable);
1780 } 1779 }
1781 1780
1782 /// [ScriptLoader] used to ensure that scripts are not loaded accidentally 1781 /// [ScriptLoader] used to ensure that scripts are not loaded accidentally
1783 /// through the [LibraryLoader] when `CompilerOptions.compileOnly` is `true`. 1782 /// through the [LibraryLoader] when `CompilerOptions.compileOnly` is `true`.
1784 class _NoScriptLoader implements ScriptLoader { 1783 class _NoScriptLoader implements ScriptLoader {
1785 Compiler compiler; 1784 Compiler compiler;
1786 _NoScriptLoader(this.compiler); 1785 _NoScriptLoader(this.compiler);
1787 1786
1788 Future<Script> readScript(Uri uri, [Spannable spannable]) { 1787 Future<Script> readScript(Uri uri, [Spannable spannable]) {
1789 compiler.reporter 1788 throw compiler.reporter
1790 .internalError(spannable, "Script loading of '$uri' is not enabled."); 1789 .internalError(spannable, "Script loading of '$uri' is not enabled.");
1791 } 1790 }
1792 } 1791 }
1793 1792
1794 class _ElementScanner implements ElementScanner { 1793 class _ElementScanner implements ElementScanner {
1795 ScannerTask scanner; 1794 ScannerTask scanner;
1796 _ElementScanner(this.scanner); 1795 _ElementScanner(this.scanner);
1797 void scanLibrary(LibraryElement library) => scanner.scanLibrary(library); 1796 void scanLibrary(LibraryElement library) => scanner.scanLibrary(library);
1798 void scanUnit(CompilationUnitElement unit) => scanner.scan(unit); 1797 void scanUnit(CompilationUnitElement unit) => scanner.scan(unit);
1799 } 1798 }
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
1967 if (library != null && library.isSynthesized) { 1966 if (library != null && library.isSynthesized) {
1968 return null; 1967 return null;
1969 } 1968 }
1970 if (library == null && required) { 1969 if (library == null && required) {
1971 throw new SpannableAssertionFailure( 1970 throw new SpannableAssertionFailure(
1972 library, "The library '${uri}' was not found."); 1971 library, "The library '${uri}' was not found.");
1973 } 1972 }
1974 return library; 1973 return library;
1975 } 1974 }
1976 } 1975 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/common_elements.dart ('k') | pkg/compiler/lib/src/constants/expressions.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698