aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2017-03-03 00:54:41 +0800
committerGitHub <noreply@github.com>2017-03-03 00:54:41 +0800
commitb49e142a26094ccb0a6e9f597e7363ba02280eb4 (patch)
treee650bd473afb447589c402673303d92b443d7c5e /test
parentee3b39b909c279a0115c7562cab2c9b37fb37c21 (diff)
downloadtracifyjs-b49e142a26094ccb0a6e9f597e7363ba02280eb4.tar.gz
tracifyjs-b49e142a26094ccb0a6e9f597e7363ba02280eb4.zip
disable do{...}while(false) optimisation (#1534)
- fails to handle `break` in body fixes #1532
Diffstat (limited to 'test')
-rw-r--r--test/compress/loops.js26
1 files changed, 25 insertions, 1 deletions
diff --git a/test/compress/loops.js b/test/compress/loops.js
index ca05461c..e26dc79f 100644
--- a/test/compress/loops.js
+++ b/test/compress/loops.js
@@ -213,6 +213,30 @@ evaluate: {
a();
for(;;)
c();
- d();
+ // rule disabled due to issue_1532
+ do d(); while (false);
+ }
+}
+
+issue_1532: {
+ options = {
+ evaluate: true,
+ loops: true,
+ }
+ input: {
+ function f(x, y) {
+ do {
+ if (x) break;
+ foo();
+ } while (false);
+ }
+ }
+ expect: {
+ function f(x, y) {
+ do {
+ if (x) break;
+ foo();
+ } while (false);
+ }
}
}