[Pkg-javascript-commits] [uglifyjs] 141/190: Add test case for hoisting a single function
Antonio Terceiro
terceiro at moszumanska.debian.org
Sun Aug 7 23:17:20 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 4d9a0856870fc8feb07771fe2e27d93c8613e857
Author: Richard van Velzen <rvanvelzen at experty.com>
Date: Tue Apr 26 11:43:03 2016 +0200
Add test case for hoisting a single function
---
test/compress/issue-1052.js | 26 +++++++++++++++++++++-----
1 file changed, 21 insertions(+), 5 deletions(-)
diff --git a/test/compress/issue-1052.js b/test/compress/issue-1052.js
index 067eea4..bad28a8 100644
--- a/test/compress/issue-1052.js
+++ b/test/compress/issue-1052.js
@@ -1,8 +1,6 @@
-hoist_funs_when_handling_if_return_rerversal: {
+multiple_functions: {
options = { if_return: true, hoist_funs: false };
input: {
- "use strict";
-
( function() {
if ( !window ) {
return;
@@ -13,8 +11,6 @@ hoist_funs_when_handling_if_return_rerversal: {
} )();
}
expect: {
- "use strict";
-
( function() {
function f() {}
function g() {}
@@ -25,3 +21,23 @@ hoist_funs_when_handling_if_return_rerversal: {
} )();
}
}
+
+single_function: {
+ options = { if_return: true, hoist_funs: false };
+ input: {
+ ( function() {
+ if ( !window ) {
+ return;
+ }
+
+ function f() {}
+ } )();
+ }
+ expect: {
+ ( function() {
+ function f() {}
+
+ if ( window );
+ } )();
+ }
+}
--
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