aboutsummaryrefslogtreecommitdiff
path: root/lib/ast.js
diff options
context:
space:
mode:
authorArnavion <arnavion@gmail.com>2014-03-22 18:02:21 -0700
committerArnavion <arnavion@gmail.com>2014-03-22 18:02:21 -0700
commite2e09d57548de10892d0595e9fb2a9978aa57726 (patch)
tree84fe6d98078bb36295ebdb16ddeeee0824c9485a /lib/ast.js
parent448a8d3845e16cd4c03fb2a0cf26b1d55307a635 (diff)
downloadtracifyjs-e2e09d57548de10892d0595e9fb2a9978aa57726.tar.gz
tracifyjs-e2e09d57548de10892d0595e9fb2a9978aa57726.zip
Allow colons in the pairs passed to AST_Toplevel.wrap_enclose
Diffstat (limited to 'lib/ast.js')
-rw-r--r--lib/ast.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/ast.js b/lib/ast.js
index 2f216c20..051cd2fb 100644
--- a/lib/ast.js
+++ b/lib/ast.js
@@ -295,10 +295,10 @@ var AST_Toplevel = DEFNODE("Toplevel", "globals", {
var parameters = [];
arg_parameter_pairs.forEach(function(pair) {
- var split = pair.split(":");
+ var splitAt = pair.lastIndexOf(":");
- args.push(split[0]);
- parameters.push(split[1]);
+ args.push(pair.substr(0, splitAt));
+ parameters.push(pair.substr(splitAt + 1));
});
var wrapped_tl = "(function(" + parameters.join(",") + "){ '$ORIG'; })(" + args.join(",") + ")";