[Pkg-javascript-commits] [uglifyjs] 131/228: fix regression: CLI options with hyphens like -b ascii-only (#1640)
Jonas Smedegaard
dr at jones.dk
Sat Apr 15 14:25:23 UTC 2017
This is an automated email from the git hooks/post-receive script.
js pushed a commit to branch master
in repository uglifyjs.
commit 79334dda105f772b7a5bfe13608a193c22537a7b
Author: kzc <kzc at users.noreply.github.com>
Date: Thu Mar 23 23:55:03 2017 -0400
fix regression: CLI options with hyphens like -b ascii-only (#1640)
fixes #1637
---
bin/uglifyjs | 2 +-
lib/parse.js | 2 ++
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/bin/uglifyjs b/bin/uglifyjs
index e39a4b4..635ca36 100755
--- a/bin/uglifyjs
+++ b/bin/uglifyjs
@@ -561,7 +561,7 @@ function getOptions(flag, constants) {
var ast;
try {
- ast = UglifyJS.parse(x, { expression: true });
+ ast = UglifyJS.parse(x, { cli: true, expression: true });
} catch(ex) {
if (ex instanceof UglifyJS.JS_Parse_Error) {
print_error("Error parsing arguments for flag `" + flag + "': " + x);
diff --git a/lib/parse.js b/lib/parse.js
index 4d37b85..99d7ce0 100644
--- a/lib/parse.js
+++ b/lib/parse.js
@@ -695,6 +695,7 @@ function parse($TEXT, options) {
html5_comments : true,
bare_returns : false,
shebang : true,
+ cli : false,
});
var S = {
@@ -1501,6 +1502,7 @@ function parse($TEXT, options) {
};
function is_assignable(expr) {
+ if (options.cli) return true;
return expr instanceof AST_PropAccess || expr instanceof AST_SymbolRef;
};
--
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