Chromium Code Reviews| 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 fasta.kernel_target; | 5 library fasta.kernel_target; |
| 6 | 6 |
| 7 import 'dart:async' show Future; | 7 import 'dart:async' show Future; |
| 8 | 8 |
| 9 import 'dart:io' show File, IOSink; | 9 import 'dart:io' show File, IOSink; |
| 10 | 10 |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 99 [Map<String, Source> uriToSource]) | 99 [Map<String, Source> uriToSource]) |
| 100 : dillTarget = dillTarget, | 100 : dillTarget = dillTarget, |
| 101 uriToSource = uriToSource ?? CompilerContext.current.uriToSource, | 101 uriToSource = uriToSource ?? CompilerContext.current.uriToSource, |
| 102 super(dillTarget.ticker, uriTranslator) { | 102 super(dillTarget.ticker, uriTranslator) { |
| 103 resetCrashReporting(); | 103 resetCrashReporting(); |
| 104 loader = createLoader(); | 104 loader = createLoader(); |
| 105 } | 105 } |
| 106 | 106 |
| 107 SourceLoader<Library> createLoader() => new SourceLoader<Library>(this); | 107 SourceLoader<Library> createLoader() => new SourceLoader<Library>(this); |
| 108 | 108 |
| 109 void addLineStarts(Uri uri, List<int> lineStarts) { | 109 void addSourceInformation(Uri uri, List<int> lineStarts, String sourceCode) { |
|
ahe
2017/03/03 12:30:32
List<int>
| |
| 110 String fileUri = relativizeUri(uri); | 110 String fileUri = relativizeUri(uri); |
| 111 uriToSource[fileUri] = new Source(lineStarts, fileUri); | 111 uriToSource[fileUri] = new Source(lineStarts, sourceCode); |
| 112 } | 112 } |
| 113 | 113 |
| 114 void read(Uri uri) { | 114 void read(Uri uri) { |
| 115 loader.read(uri); | 115 loader.read(uri); |
| 116 } | 116 } |
| 117 | 117 |
| 118 LibraryBuilder createLibraryBuilder(Uri uri, Uri fileUri) { | 118 LibraryBuilder createLibraryBuilder(Uri uri, Uri fileUri) { |
| 119 if (dillTarget.isLoaded) { | 119 if (dillTarget.isLoaded) { |
| 120 var builder = dillTarget.loader.builders[uri]; | 120 var builder = dillTarget.loader.builders[uri]; |
| 121 if (builder != null) { | 121 if (builder != null) { |
| (...skipping 481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 603 } | 603 } |
| 604 for (Constructor constructor in superclass.constructors) { | 604 for (Constructor constructor in superclass.constructors) { |
| 605 if (constructor.name.name.isEmpty) { | 605 if (constructor.name.name.isEmpty) { |
| 606 return constructor.function.requiredParameterCount == 0 | 606 return constructor.function.requiredParameterCount == 0 |
| 607 ? constructor | 607 ? constructor |
| 608 : null; | 608 : null; |
| 609 } | 609 } |
| 610 } | 610 } |
| 611 return null; | 611 return null; |
| 612 } | 612 } |
| OLD | NEW |