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

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

Issue 903563003: Add sourceMaps option to $dart2js transformer. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Minor formatting Created 5 years, 10 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 | sdk/lib/_internal/pub/test/dart2js/includes_source_maps_if_sourceMaps_true_test.dart » ('j') | 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 35740f0e5d25275532effb224178d2a9d78abab5..dead76f2d546b48086bb925bae6e768cfa0dc648 100644
--- a/sdk/lib/_internal/pub/lib/src/barback/dart2js_transformer.dart
+++ b/sdk/lib/_internal/pub/lib/src/barback/dart2js_transformer.dart
@@ -25,7 +25,7 @@ import 'asset_environment.dart';
final _validOptions = new Set<String>.from([
'commandLineOptions', 'checked', 'csp', 'minify', 'verbose', 'environment',
'preserveUris', 'suppressWarnings', 'suppressHints',
- 'suppressPackageWarnings', 'terse'
+ 'suppressPackageWarnings', 'terse', 'sourceMaps'
]);
/// A [Transformer] that uses dart2js's library API to transform Dart
@@ -42,7 +42,8 @@ class Dart2JSTransformer extends Transformer implements LazyTransformer {
final BarbackSettings _settings;
/// Whether source maps should be generated for the compiled JS.
- bool get _generateSourceMaps => _settings.mode != BarbackMode.RELEASE;
+ bool get _generateSourceMaps => _configBool('sourceMaps',
+ defaultsTo: _settings.mode != BarbackMode.RELEASE);
Dart2JSTransformer.withSettings(this._environment, this._settings) {
var invalidOptions = _settings.configuration.keys.toSet()
@@ -146,7 +147,7 @@ class Dart2JSTransformer extends Transformer implements LazyTransformer {
suppressPackageWarnings: _configBool(
'suppressPackageWarnings', defaultsTo: true),
terse: _configBool('terse'),
- includeSourceMapUrls: _settings.mode != BarbackMode.RELEASE);
+ includeSourceMapUrls: _generateSourceMaps);
}
/// Parses and returns the "commandLineOptions" configuration option.
« no previous file with comments | « no previous file | sdk/lib/_internal/pub/test/dart2js/includes_source_maps_if_sourceMaps_true_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698