Fix names of map files in the startup emitter.

R=sigmund@google.com

Review URL: https://codereview.chromium.org//1295873002 .
This commit is contained in:
Florian Loitsch 2015-08-14 22:22:46 +02:00
parent f0b81a44bb
commit f9d05b6e29

View file

@ -86,6 +86,7 @@ class ModelEmitter {
static const String deferredInitializersGlobal =
r"$__dart_deferred_initializers__";
static const String partExtension = "part";
static const String deferredExtension = "part.js";
static const String typeNameProperty = r"builtin$cls";
@ -279,7 +280,7 @@ class ModelEmitter {
if (shouldGenerateSourceMap) {
outputSourceMap(mainOutput, lineColumnCollector, '',
compiler.sourceMapUri, compiler.outputUri);
compiler.sourceMapUri, compiler.outputUri);
}
}
@ -336,17 +337,17 @@ class ModelEmitter {
Uri mapUri, partUri;
Uri sourceMapUri = compiler.sourceMapUri;
Uri outputUri = compiler.outputUri;
String partName = "$hunkPrefix.$partExtension";
String hunkFileName = "$hunkPrefix.$deferredExtension";
if (sourceMapUri != null) {
String mapFileName =
hunkPrefix + deferredExtension + ".map";
String mapFileName = hunkFileName + ".map";
List<String> mapSegments = sourceMapUri.pathSegments.toList();
mapSegments[mapSegments.length - 1] = mapFileName;
mapUri = compiler.sourceMapUri.replace(pathSegments: mapSegments);
}
if (outputUri != null) {
String hunkFileName = hunkPrefix + deferredExtension;
List<String> partSegments = outputUri.pathSegments.toList();
partSegments[partSegments.length - 1] = hunkFileName;
partUri = compiler.outputUri.replace(pathSegments: partSegments);
@ -354,7 +355,7 @@ class ModelEmitter {
output.add(generateSourceMapTag(mapUri, partUri));
output.close();
outputSourceMap(output, lineColumnCollector, hunkPrefix, mapUri, partUri);
outputSourceMap(output, lineColumnCollector, partName, mapUri, partUri);
} else {
output.close();
}