diff --git a/src/util.js b/src/util.js index 5a0041a27..983e2c4f8 100644 --- a/src/util.js +++ b/src/util.js @@ -331,7 +331,8 @@ function lineShouldEndWithSemicolon(path) { "property", "string", "boolean", - "number" + "number", + "nowdoc" ]; if (node.kind === "traituse") { return !node.adaptations; diff --git a/tests/nowdoc/__snapshots__/jsfmt.spec.js.snap b/tests/nowdoc/__snapshots__/jsfmt.spec.js.snap new file mode 100644 index 000000000..4c0162165 --- /dev/null +++ b/tests/nowdoc/__snapshots__/jsfmt.spec.js.snap @@ -0,0 +1,48 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`nowdoc.php 1`] = ` +foo. +Now, I am printing some {$foo->bar[1]}. +This should not print a capital 'A': \\x41 +EOT; +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +foo. +Now, I am printing some {$foo->bar[1]}. +This should not print a capital 'A': \\x41 +EOT; + +`; + +exports[`single.php 1`] = ` +foo. +Now, I am printing some {$foo->bar[1]}. +This should not print a capital 'A': \x41 +EOT; diff --git a/tests/nowdoc/single.php b/tests/nowdoc/single.php new file mode 100644 index 000000000..39b50464c --- /dev/null +++ b/tests/nowdoc/single.php @@ -0,0 +1,6 @@ +