aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2017-03-31 15:26:57 +0800
committerGitHub <noreply@github.com>2017-03-31 15:26:57 +0800
commit11e9bdc42746832cfa1c52ca70b0171b31a422ba (patch)
tree7c8c7f5944cbb2f29981cdf5dc48af17a098cf86 /lib
parenta84564d1a8b1fda740963a577f4916d15a20138b (diff)
downloadtracifyjs-11e9bdc42746832cfa1c52ca70b0171b31a422ba.tar.gz
tracifyjs-11e9bdc42746832cfa1c52ca70b0171b31a422ba.zip
fix missing preamble when shebang is absent (#1742)
Diffstat (limited to 'lib')
-rw-r--r--lib/output.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/output.js b/lib/output.js
index c8c8739f..ac9e0654 100644
--- a/lib/output.js
+++ b/lib/output.js
@@ -510,8 +510,8 @@ function OutputStream(options) {
}));
}
- if (comments.length > 0 && output.pos() == 0) {
- if (output.option("shebang") && comments[0].type == "comment5") {
+ if (output.pos() == 0) {
+ if (comments.length > 0 && output.option("shebang") && comments[0].type == "comment5") {
output.print("#!" + comments.shift().value + "\n");
output.indent();
}