[Pkg-javascript-commits] [uglifyjs] 257/491: improve variations on call arguments for `ufuzz` (#2424)
Jonas Smedegaard
dr at jones.dk
Wed Feb 14 19:51:42 UTC 2018
This is an automated email from the git hooks/post-receive script.
js pushed a commit to annotated tag debian/3.3.10-1
in repository uglifyjs.
commit 71e61153b1b3d5f2446b83a3507231509e11e90e
Author: Alex Lam S.L <alexlamsl at gmail.com>
Date: Sat Nov 4 16:29:42 2017 +0800
improve variations on call arguments for `ufuzz` (#2424)
---
test/ufuzz.js | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/test/ufuzz.js b/test/ufuzz.js
index d6a2a45..702e207 100644
--- a/test/ufuzz.js
+++ b/test/ufuzz.js
@@ -350,10 +350,10 @@ function createParams() {
return params.join(', ');
}
-function createArgs() {
+function createArgs(recurmax, stmtDepth, canThrow) {
var args = [];
for (var n = rng(4); --n >= 0;) {
- args.push(createValue());
+ args.push(createExpression(recurmax, COMMA_OK, stmtDepth, canThrow));
}
return args.join(', ');
}
@@ -391,9 +391,10 @@ function createFunction(recurmax, inGlobal, noDecl, canThrow, stmtDepth) {
VAR_NAMES.length = namesLenBefore;
- if (noDecl) s = 'var ' + createVarName(MANDATORY) + ' = ' + s + '(' + createExpression(recurmax, COMMA_OK, stmtDepth, canThrow) + ');';
+ if (noDecl) s = 'var ' + createVarName(MANDATORY) + ' = ' + s;
// avoid "function statements" (decl inside statements)
- else if (inGlobal || rng(10) > 0) s += 'var ' + createVarName(MANDATORY) + ' = ' + name + '(' + createArgs() + ');';
+ else if (inGlobal || rng(10) > 0) s += 'var ' + createVarName(MANDATORY) + ' = ' + name;
+ s += '(' + createArgs(recurmax, stmtDepth, canThrow) + ');';
return s;
}
@@ -628,6 +629,9 @@ function _createExpression(recurmax, noComma, stmtDepth, canThrow) {
case p++:
return createValue();
case p++:
+ case p++:
+ return getVarName();
+ case p++:
return createExpression(recurmax, COMMA_OK, stmtDepth, canThrow);
case p++:
return createExpression(recurmax, noComma, stmtDepth, canThrow) + '?' + createExpression(recurmax, NO_COMMA, stmtDepth, canThrow) + ':' + createExpression(recurmax, noComma, stmtDepth, canThrow);
--
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