Commits

Mathias Panzenböck committed b324958

more bugfixes

  • Participants
  • Parent commits 5c51b10

Comments (0)

Files changed (2)

File lib/minvisitor.js

 	visitUnaryExpression: function (node) {
 		var op = node.operator;
 		var arg = this.visit(node.argument);
-		if (node.hasPrecedence(node)) {
+		if (node.hasPrecedence(node.argument)) {
 			arg = '('+arg+')';
 		}
 		switch (op) {
 		if (node.hasLeftPrecedence(node.test)) {
 			test = '('+test+')';
 		}
+		if (node.hasPrecedence(node.consequent)) {
+			cons = '('+cons+')';
+		}
 		if (node.hasRightPrecedence(node.alternate)) {
 			alt = '('+alt+')';
 		}

File lib/optimizingvisitor.js

 			new nodes.BlockStatement(body, node.body.loc),
 			node.loc);
 	},
+	visitCatchClause: function (node) {
+		var body = optimizeStatementList(node.body.body.map(this.visit.bind(this)));
+		return this.catchClause(
+			this.visit(node.param),
+			new nodes.BlockStatement(body, node.body.loc),
+			node.loc);
+			
+	},
 	binaryExpression: function (op, left, right, loc) {
 		if (left.type === "Literal" && right.type === "Literal") {
 			switch (op) {