Don't mix strings with directives in output

* Don't interpret strings with escaped content as directive
 * Don't interpret strings after empty statement as directive
 * Adapt output to prevent strings being represent as directive
 * Introduce UGLIFY_DEBUG to allow internal testing like EXPECT_DIRECTIVE
This commit is contained in:
Anthony Van de Gejuchte
2016-06-13 21:11:08 +02:00
committed by Richard van Velzen
parent d7971ba0e4
commit 2149bfb707
8 changed files with 361 additions and 15 deletions

View File

@@ -452,7 +452,7 @@ can pass additional arguments that control the code output:
objects
- `space-colon` (default `true`) -- insert a space after the colon signs
- `ascii-only` (default `false`) -- escape Unicode characters in strings and
regexps
regexps (affects directives with non-ascii characters becoming invalid)
- `inline-script` (default `false`) -- escape the slash in occurrences of
`</script` in strings
- `width` (default 80) -- only takes effect when beautification is on, this