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

Unified Diff: lib/src/codegen/js_printer.dart

Issue 1263583005: implement exports, fixes #141 (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: rebase Created 5 years, 4 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: lib/src/codegen/js_printer.dart
diff --git a/lib/src/codegen/js_printer.dart b/lib/src/codegen/js_printer.dart
index e5545e6e42d39bfa9e387bc780796e658897c1c8..37584724776ebf564d059c256de5ae46ed94d620 100644
--- a/lib/src/codegen/js_printer.dart
+++ b/lib/src/codegen/js_printer.dart
@@ -4,7 +4,7 @@
library dev_compiler.src.codegen.js_printer;
-import 'dart:io' show Directory, File;
+import 'dart:io' show Directory, File, Platform, Process;
import 'package:analyzer/src/generated/ast.dart';
import 'package:path/path.dart' as path;
import 'package:source_maps/source_maps.dart' as srcmaps show Printer;
@@ -48,6 +48,12 @@ String writeJsLibrary(JS.Program jsTree, String outputPath,
text = (context as JS.SimpleJavaScriptPrintingContext).getText();
}
new File(outputPath).writeAsStringSync(text);
+ if (jsTree.scriptTag != null) {
+ // Mark executable.
+ // TODO(jmesserly): should only do this if the input file was executable?
+ if (!Platform.isWindows) Process.runSync('chmod', ['+x', outputPath]);
+ }
+
return computeHash(text);
}

Powered by Google App Engine
This is Rietveld 408576698