[Pkg-javascript-commits] [uglifyjs] 142/190: Add test cases for slightly more esoteric cases
Antonio Terceiro
terceiro at moszumanska.debian.org
Sun Aug 7 23:17:21 UTC 2016
This is an automated email from the git hooks/post-receive script.
terceiro pushed a commit to annotated tag upstream/2.7.0
in repository uglifyjs.
commit e9224ab4441ddb352566a52b84f1384bf5b8a8d8
Author: Richard van Velzen <rvanvelzen at experty.com>
Date: Tue Apr 26 11:49:55 2016 +0200
Add test cases for slightly more esoteric cases
---
test/compress/issue-1052.js | 53 +++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 53 insertions(+)
diff --git a/test/compress/issue-1052.js b/test/compress/issue-1052.js
index bad28a8..0a77f00 100644
--- a/test/compress/issue-1052.js
+++ b/test/compress/issue-1052.js
@@ -41,3 +41,56 @@ single_function: {
} )();
}
}
+
+deeply_nested: {
+ options = { if_return: true, hoist_funs: false };
+ input: {
+ ( function() {
+ if ( !window ) {
+ return;
+ }
+
+ function f() {}
+ function g() {}
+
+ if ( !document ) {
+ return;
+ }
+
+ function h() {}
+ } )();
+ }
+ expect: {
+ ( function() {
+ function f() {}
+ function g() {}
+
+ function h() {}
+
+ // NOTE: other compression steps will reduce this
+ // down to just `window`.
+ if ( window )
+ if (document);
+ } )();
+ }
+}
+
+not_hoisted_when_already_nested: {
+ options = { if_return: true, hoist_funs: false };
+ input: {
+ ( function() {
+ if ( !window ) {
+ return;
+ }
+
+ if ( foo ) function f() {}
+
+ } )();
+ }
+ expect: {
+ ( function() {
+ if ( window )
+ if ( foo ) function f() {}
+ } )();
+ }
+}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/uglifyjs.git
More information about the Pkg-javascript-commits
mailing list