Skip to content

Commit

Permalink
fixed files form Closure #64
Browse files Browse the repository at this point in the history
  • Loading branch information
tdurieux committed Mar 7, 2017
1 parent 5392a25 commit 57e7253
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1429,7 +1429,7 @@ public Void call() throws Exception {

// if LanguageMode is ECMASCRIPT5_STRICT, only print 'use strict'
// for the first input file
String code = toSource(root, sourceMap);
String code = toSource(root, sourceMap, inputSeqNum == 0);
if (!code.isEmpty()) {
cb.append(code);

Expand Down Expand Up @@ -1458,19 +1458,19 @@ public Void call() throws Exception {
@Override
String toSource(Node n) {
initCompilerOptionsIfTesting();
return toSource(n, null);
return toSource(n, null, true);
}

/**
* Generates JavaScript source code for an AST.
*/
private String toSource(Node n, SourceMap sourceMap) {
private String toSource(Node n, SourceMap sourceMap, boolean firstOutput) {
CodePrinter.Builder builder = new CodePrinter.Builder(n);
builder.setPrettyPrint(options.prettyPrint);
builder.setLineBreak(options.lineBreak);
builder.setSourceMap(sourceMap);
builder.setSourceMapDetailLevel(options.sourceMapDetailLevel);
builder.setTagAsStrict(
builder.setTagAsStrict(firstOutput &&
options.getLanguageOut() == LanguageMode.ECMASCRIPT5_STRICT);
builder.setLineLengthThreshold(options.lineLengthThreshold);

Expand Down

0 comments on commit 57e7253

Please sign in to comment.