employ a better parser for command-line arguments
to support passing commas in strings in for example:
uglifyjs2 -cd TEST="'a,b'" <<EOF
console.log(TEST);
EOF
→ console.log("a,b")
close #14
This commit is contained in:
@@ -134,6 +134,17 @@ merge(Compressor.prototype, {
|
||||
};
|
||||
|
||||
function make_node_from_constant(compressor, val, orig) {
|
||||
// XXX: WIP.
|
||||
// if (val instanceof AST_Node) return val.transform(new TreeTransformer(null, function(node){
|
||||
// if (node instanceof AST_SymbolRef) {
|
||||
// var scope = compressor.find_parent(AST_Scope);
|
||||
// var def = scope.find_variable(node);
|
||||
// node.thedef = def;
|
||||
// return node;
|
||||
// }
|
||||
// })).transform(compressor);
|
||||
|
||||
if (val instanceof AST_Node) return val.transform(compressor);
|
||||
switch (typeof val) {
|
||||
case "string":
|
||||
return make_node(AST_String, orig, {
|
||||
|
||||
Reference in New Issue
Block a user