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

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

Issue 1106713003: Support defining environment constants for dart2js via the command-line. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Code review changes Created 5 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
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 8c7ff14c0ebc63467759ac3ca87c8bc4f7dbe34a..9097e0747d2d38c37826e1478e9091d0f47fe76a 100644
--- a/sdk/lib/_internal/pub/lib/src/barback/dart2js_transformer.dart
+++ b/sdk/lib/_internal/pub/lib/src/barback/dart2js_transformer.dart
@@ -166,13 +166,15 @@ class Dart2JSTransformer extends Transformer implements LazyTransformer {
/// Parses and returns the "environment" configuration option.
Map<String, String> get _configEnvironment {
- if (!_settings.configuration.containsKey('environment')) return null;
+ if (!_settings.configuration.containsKey('environment')) {
+ return _environment.environmentConstants;
+ }
var environment = _settings.configuration['environment'];
if (environment is Map &&
environment.keys.every((key) => key is String) &&
environment.values.every((key) => key is String)) {
- return environment;
+ return mergeMaps(environment, _environment.environmentConstants);
}
throw new FormatException('Invalid value for \$dart2js.environment: '
« no previous file with comments | « sdk/lib/_internal/pub/lib/src/barback/asset_environment.dart ('k') | sdk/lib/_internal/pub/lib/src/command/build.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698