aboutsummaryrefslogtreecommitdiff
path: root/test/input
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2017-02-24 07:33:57 +0800
committerGitHub <noreply@github.com>2017-02-24 07:33:57 +0800
commit229e42cdee14c384b7a48bd0882bb27d98db040a (patch)
treeaefc78b2d7dded10d049296336324933596d770d /test/input
parenteb55d8a9bb37cc28303ace91337784dbf0777d03 (diff)
parent4e49302916fe395f5c63992aa28c33392208fb27 (diff)
downloadtracifyjs-229e42cdee14c384b7a48bd0882bb27d98db040a.tar.gz
tracifyjs-229e42cdee14c384b7a48bd0882bb27d98db040a.zip
Merge pull request #1485 from alexlamsl/merge-2.8.0
2.8.0 staging
Diffstat (limited to 'test/input')
-rw-r--r--test/input/global_defs/nested.js1
-rw-r--r--test/input/global_defs/simple.js1
-rw-r--r--test/input/issue-1482/bracketize.js73
-rw-r--r--test/input/issue-1482/default.js17
-rw-r--r--test/input/issue-1482/input.js12
5 files changed, 104 insertions, 0 deletions
diff --git a/test/input/global_defs/nested.js b/test/input/global_defs/nested.js
new file mode 100644
index 00000000..dbf57909
--- /dev/null
+++ b/test/input/global_defs/nested.js
@@ -0,0 +1 @@
+console.log(C.V, C.D);
diff --git a/test/input/global_defs/simple.js b/test/input/global_defs/simple.js
new file mode 100644
index 00000000..44d515e3
--- /dev/null
+++ b/test/input/global_defs/simple.js
@@ -0,0 +1 @@
+console.log(D);
diff --git a/test/input/issue-1482/bracketize.js b/test/input/issue-1482/bracketize.js
new file mode 100644
index 00000000..2c2b103c
--- /dev/null
+++ b/test/input/issue-1482/bracketize.js
@@ -0,0 +1,73 @@
+if (x) {
+ foo();
+}
+
+if (x) {
+ foo();
+} else {
+ baz();
+}
+
+if (x) {
+ foo();
+} else if (y) {
+ bar();
+} else {
+ baz();
+}
+
+if (x) {
+ if (y) {
+ foo();
+ } else {
+ bar();
+ }
+} else {
+ baz();
+}
+
+if (x) {
+ foo();
+} else if (y) {
+ bar();
+} else if (z) {
+ baz();
+} else {
+ moo();
+}
+
+function f() {
+ if (x) {
+ foo();
+ }
+ if (x) {
+ foo();
+ } else {
+ baz();
+ }
+ if (x) {
+ foo();
+ } else if (y) {
+ bar();
+ } else {
+ baz();
+ }
+ if (x) {
+ if (y) {
+ foo();
+ } else {
+ bar();
+ }
+ } else {
+ baz();
+ }
+ if (x) {
+ foo();
+ } else if (y) {
+ bar();
+ } else if (z) {
+ baz();
+ } else {
+ moo();
+ }
+}
diff --git a/test/input/issue-1482/default.js b/test/input/issue-1482/default.js
new file mode 100644
index 00000000..14054e98
--- /dev/null
+++ b/test/input/issue-1482/default.js
@@ -0,0 +1,17 @@
+if (x) foo();
+
+if (x) foo(); else baz();
+
+if (x) foo(); else if (y) bar(); else baz();
+
+if (x) if (y) foo(); else bar(); else baz();
+
+if (x) foo(); else if (y) bar(); else if (z) baz(); else moo();
+
+function f() {
+ if (x) foo();
+ if (x) foo(); else baz();
+ if (x) foo(); else if (y) bar(); else baz();
+ if (x) if (y) foo(); else bar(); else baz();
+ if (x) foo(); else if (y) bar(); else if (z) baz(); else moo();
+}
diff --git a/test/input/issue-1482/input.js b/test/input/issue-1482/input.js
new file mode 100644
index 00000000..0186e82c
--- /dev/null
+++ b/test/input/issue-1482/input.js
@@ -0,0 +1,12 @@
+if (x) foo();
+if (x) foo(); else baz();
+if (x) foo(); else if (y) bar(); else baz();
+if (x) if (y) foo(); else bar(); else baz();
+if (x) foo(); else if (y) bar(); else if (z) baz(); else moo();
+function f() {
+if (x) foo();
+if (x) foo(); else baz();
+if (x) foo(); else if (y) bar(); else baz();
+if (x) if (y) foo(); else bar(); else baz();
+if (x) foo(); else if (y) bar(); else if (z) baz(); else moo();
+}