aboutsummaryrefslogtreecommitdiff
path: root/test/compress/screw-ie8.js
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2017-03-18 01:56:15 +0800
committerGitHub <noreply@github.com>2017-03-18 01:56:15 +0800
commitfb092839c26ddaa0614df5295be85ea207bda9f7 (patch)
treea2e30e98953c57bd7faecbf6c2541a3707bb02ea /test/compress/screw-ie8.js
parentb7c112eefe4b7840cefd85287e3f858784c56a59 (diff)
downloadtracifyjs-fb092839c26ddaa0614df5295be85ea207bda9f7.tar.gz
tracifyjs-fb092839c26ddaa0614df5295be85ea207bda9f7.zip
fix top-level directives in compress tests (#1615)
`input` and `expect` are parsed as `AST_BlockStatement` which does not support `AST_Directive` by default. Emulate that by transforming preceding `AST_SimpleStatement`s of `AST_String` into `AST_Directive`.
Diffstat (limited to 'test/compress/screw-ie8.js')
-rw-r--r--test/compress/screw-ie8.js31
1 files changed, 20 insertions, 11 deletions
diff --git a/test/compress/screw-ie8.js b/test/compress/screw-ie8.js
index 4fbb95c8..0fb68c25 100644
--- a/test/compress/screw-ie8.js
+++ b/test/compress/screw-ie8.js
@@ -1,20 +1,29 @@
do_screw: {
- options = { screw_ie8: true };
+ options = {
+ screw_ie8: true,
+ }
beautify = {
screw_ie8: true,
- ascii_only: true
- };
-
- input: f("\v");
- expect_exact: 'f("\\v");';
+ ascii_only: true,
+ }
+ input: {
+ f("\v");
+ }
+ expect_exact: 'f("\\v");'
}
dont_screw: {
- options = { screw_ie8: false };
- beautify = { screw_ie8: false, ascii_only: true };
-
- input: f("\v");
- expect_exact: 'f("\\x0B");';
+ options = {
+ screw_ie8: false,
+ }
+ beautify = {
+ screw_ie8: false,
+ ascii_only: true,
+ }
+ input: {
+ f("\v");
+ }
+ expect_exact: 'f("\\x0B");'
}
do_screw_constants: {