Skip to content

Commit

Permalink
Fix server mode
Browse files Browse the repository at this point in the history
TBR=jmesserly@google.com

Review URL: https://codereview.chromium.org/1235293004.
  • Loading branch information
vsmenon committed Jul 18, 2015
1 parent 60aba74 commit 9fe41d1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
5 changes: 4 additions & 1 deletion pkg/dev_compiler/lib/src/codegen/html_codegen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,15 @@ String generateEntryHtml(HtmlSourceNode root, AbstractCompiler compiler) {
}

String mainLibraryName;
var src = scripts[0].attributes["src"];
var scriptUri = root.source.resolveRelativeUri(Uri.parse(src));

for (var lib in libraries) {
var info = lib.info;
if (info == null) continue;
var uri = info.library.source.uri;
var jsPath = compiler.getModulePath(uri);
if (info.isEntry) mainLibraryName = compiler.getModuleName(uri);
if (uri == scriptUri) mainLibraryName = compiler.getModuleName(uri);
if (lib.cachingHash != null) {
jsPath = _addHash(jsPath, lib.cachingHash);
}
Expand Down
7 changes: 4 additions & 3 deletions pkg/dev_compiler/lib/src/server/server.dart
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,12 @@ class ServerCompiler extends AbstractCompiler {
var graph = new SourceGraph(context, reporter, options);
var entryNode = graph.nodeFromUri(inputUri);

return new ServerCompiler._(options, context, reporter, entryNode);
return new ServerCompiler._(context, options, reporter, entryNode);
}

ServerCompiler._(context, options, reporter, this._entryNode)
: super(options, context, reporter) {
ServerCompiler._(AnalysisContext context, CompilerOptions options,
AnalysisErrorListener reporter, this._entryNode)
: super(context, options, reporter) {
if (outputDir != null) {
_generators.add(new JSGenerator(this));
}
Expand Down

0 comments on commit 9fe41d1

Please sign in to comment.