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

Unified Diff: sdk/lib/_internal/pub/lib/src/barback/dart2js_transformer.dart

Issue 231973002: Properly check to see if dart2js is generating source maps before declaring them. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/pub/lib/src/barback/dart2js_transformer.dart
diff --git a/sdk/lib/_internal/pub/lib/src/barback/dart2js_transformer.dart b/sdk/lib/_internal/pub/lib/src/barback/dart2js_transformer.dart
index 6e926f385cc2cc4ffbd06bb8d9266392db1b1d02..ca71b159c979583e9fa14d50877191248ecad331 100644
--- a/sdk/lib/_internal/pub/lib/src/barback/dart2js_transformer.dart
+++ b/sdk/lib/_internal/pub/lib/src/barback/dart2js_transformer.dart
@@ -43,6 +43,9 @@ class Dart2JSTransformer extends Transformer implements LazyTransformer {
final BuildEnvironment _environment;
final BarbackSettings _settings;
+ /// Whether source maps should be generated for the compiled JS.
+ bool get _generateSourceMaps => _settings.mode != BarbackMode.RELEASE;
+
Dart2JSTransformer.withSettings(this._environment, this._settings) {
var invalidOptions = _settings.configuration.keys.toSet()
.difference(_validOptions);
@@ -89,7 +92,7 @@ class Dart2JSTransformer extends Transformer implements LazyTransformer {
var primaryId = transform.primaryId;
transform.declareOutput(primaryId.addExtension(".js"));
transform.declareOutput(primaryId.addExtension(".precompiled.js"));
- if (generateSourceMaps) {
+ if (_generateSourceMaps) {
transform.declareOutput(primaryId.addExtension(".js.map"));
}
return new Future.value();
@@ -117,7 +120,7 @@ class Dart2JSTransformer extends Transformer implements LazyTransformer {
/// Run the dart2js compiler.
Future _doCompilation(Transform transform) {
var provider = new _BarbackCompilerProvider(_environment, transform,
- generateSourceMaps: _settings.mode != BarbackMode.RELEASE);
+ generateSourceMaps: _generateSourceMaps);
// Create a "path" to the entrypoint script. The entrypoint may not actually
// be on disk, but this gives dart2js a root to resolve relative paths
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698