aboutsummaryrefslogtreecommitdiff
path: root/lib/ast.js
diff options
context:
space:
mode:
authorMihai Bazon <mihai@bazon.net>2012-08-21 11:38:49 +0300
committerMihai Bazon <mihai@bazon.net>2012-08-21 11:38:49 +0300
commit99456c6156f8a05734a82be97348ace72aa1ee2a (patch)
tree284425053132542fe920af3e7fb98f1365685eb2 /lib/ast.js
parent458e251d7ed6e9ac97849237264caa40a40c76b3 (diff)
downloadtracifyjs-99456c6156f8a05734a82be97348ace72aa1ee2a.tar.gz
tracifyjs-99456c6156f8a05734a82be97348ace72aa1ee2a.zip
more fixes:
- added walker for AST_ObjectProperty - handle redefinitions properly (only mangle one symbol, make them all point to a single definition) DynarchLIB seems to run fine after mangling + compressed output.
Diffstat (limited to 'lib/ast.js')
-rw-r--r--lib/ast.js10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/ast.js b/lib/ast.js
index ac5010bb..89a8237b 100644
--- a/lib/ast.js
+++ b/lib/ast.js
@@ -136,7 +136,7 @@ var AST_ForIn = DEFNODE("ForIn", "init name object", {
_walk: function(visitor) {
return visitor._visit(this, function(){
if (this.init) this.init._walk(visitor);
- if (this.name) this.name._walk(visitor);
+ else if (this.name) this.name._walk(visitor);
if (this.object) this.object._walk(visitor);
this.body._walk(visitor);
});
@@ -461,7 +461,13 @@ var AST_Object = DEFNODE("Object", "properties", {
}
});
-var AST_ObjectProperty = DEFNODE("ObjectProperty", "key value");
+var AST_ObjectProperty = DEFNODE("ObjectProperty", "key value", {
+ _walk: function(visitor) {
+ return visitor._visit(this, function(){
+ this.value._walk(visitor);
+ });
+ }
+});
var AST_ObjectKeyVal = DEFNODE("ObjectKeyval", null, {
}, AST_ObjectProperty);