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

Unified Diff: dart/sdk/lib/_internal/compiler/samples/jsonify/jsonify.dart

Issue 133893008: Add GYP build rule for Try Dart! (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Address comments from Kasper and Martin Created 6 years, 11 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 | « dart/dart.gyp ('k') | dart/site/try/app.yaml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/sdk/lib/_internal/compiler/samples/jsonify/jsonify.dart
diff --git a/dart/sdk/lib/_internal/compiler/samples/jsonify/jsonify.dart b/dart/sdk/lib/_internal/compiler/samples/jsonify/jsonify.dart
index 36596aaa2b91d4e02e92a1f87ddd0e251d239851..e639c4e52e9ef70a071500a93f9cdda7c92eff84 100644
--- a/dart/sdk/lib/_internal/compiler/samples/jsonify/jsonify.dart
+++ b/dart/sdk/lib/_internal/compiler/samples/jsonify/jsonify.dart
@@ -31,6 +31,8 @@ var handler;
RandomAccessFile output;
Uri outputUri;
Uri sdkRoot;
+const bool outputJson =
+ const bool.fromEnvironment('outputJson', defaultValue: false);
main(List<String> arguments) {
handler = new FormattingDiagnosticHandler()
@@ -77,7 +79,10 @@ jsonify(MirrorSystem mirrors) {
}
});
- output.writeStringSync('''
+ if (outputJson) {
+ output.writeStringSync(JSON.encode(map));
+ } else {
+ output.writeStringSync('''
// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@@ -88,7 +93,8 @@ jsonify(MirrorSystem mirrors) {
library dart.sdk_sources;
const Map<String, String> SDK_SOURCES = const <String, String>''');
- output.writeStringSync(JSON.encode(map).replaceAll(r'$', r'\$'));
- output.writeStringSync(';\n');
+ output.writeStringSync(JSON.encode(map).replaceAll(r'$', r'\$'));
+ output.writeStringSync(';\n');
+ }
output.closeSync();
}
« no previous file with comments | « dart/dart.gyp ('k') | dart/site/try/app.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698