diff options
author | Mihai Bazon <mihai@bazon.net> | 2012-10-17 15:56:45 +0300 |
---|---|---|
committer | Mihai Bazon <mihai@bazon.net> | 2012-10-17 15:56:45 +0300 |
commit | a21f3c6cdd27696770b5cc605b5f02d81f0a32af (patch) | |
tree | c9423d2fea130852d11574153aae8b704ea5cf67 /lib | |
parent | 8f664585983e4174bb850e3975659127eb99df36 (diff) | |
download | tracifyjs-a21f3c6cdd27696770b5cc605b5f02d81f0a32af.tar.gz tracifyjs-a21f3c6cdd27696770b5cc605b5f02d81f0a32af.zip |
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
Diffstat (limited to 'lib')
-rw-r--r-- | lib/compress.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/compress.js b/lib/compress.js index f216ed22..4a51a49f 100644 --- a/lib/compress.js +++ b/lib/compress.js @@ -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, { |