Skip to content

Commit

Permalink
Fix boolean logic error
Browse files Browse the repository at this point in the history
I thought that this would result in the following if-block executing, as
needed to pass the test case in the previous commit. However, it appears
that it's not actually needed to pass the test case, since `makeString`
doesn't unescape unnecessarily escaped non-quote characters.
Nevertheless, I think we should leave that if-block (`if (canChangeDirectiveQuotes)`)
there, in case `makeString` is updated.

See #1571 (comment)
  • Loading branch information
josephfrazier committed May 10, 2017
1 parent b6da0c3 commit 0b6d19d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/printer.js
Original file line number Diff line number Diff line change
Expand Up @@ -3876,7 +3876,7 @@ function nodeStr(node, options) {
// change the escape sequences they use.
// See https://github.com/prettier/prettier/issues/1555
// and https://tc39.github.io/ecma262/#directive-prologue
if (isDirectiveLiteral && !canChangeDirectiveQuotes) {
if (isDirectiveLiteral) {
if (canChangeDirectiveQuotes) {
return enclosingQuote + rawContent + enclosingQuote;
} else {
Expand Down

0 comments on commit 0b6d19d

Please sign in to comment.