Skip to content

Commit

Permalink
fix regression: CLI options with hyphens like -b ascii-only (#1640)
Browse files Browse the repository at this point in the history
fixes #1637
  • Loading branch information
kzc authored and alexlamsl committed Mar 24, 2017
1 parent e918748 commit 79334dd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion bin/uglifyjs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 2 additions & 0 deletions lib/parse.js
Original file line number Diff line number Diff line change
Expand Up @@ -695,6 +695,7 @@ function parse($TEXT, options) {
html5_comments : true,
bare_returns : false,
shebang : true,
cli : false,
});

var S = {
Expand Down Expand Up @@ -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;
};

Expand Down

0 comments on commit 79334dd

Please sign in to comment.