if (x instanceof type) return x;
}
},
+ has_directive: function(type) {
+ return this.find_parent(AST_Scope).has_directive(type);
+ },
in_boolean_context: function() {
var stack = this.stack;
var i = stack.length, self = stack[--i];
var commutativeOperators = makePredicate("== === != !== * & | ^");
OPT(AST_Binary, function(self, compressor){
- function reverse(op, force) {
- if (force || !(self.left.has_side_effects() || self.right.has_side_effects())) {
- if (op) self.operator = op;
- var tmp = self.left;
- self.left = self.right;
- self.right = tmp;
- }
- };
+ var reverse = compressor.has_directive("use asm") ? noop
+ : function(op, force) {
+ if (force || !(self.left.has_side_effects() || self.right.has_side_effects())) {
+ if (op) self.operator = op;
+ var tmp = self.left;
+ self.left = self.right;
+ self.right = tmp;
+ }
+ };
if (commutativeOperators(self.operator)) {
if (self.right instanceof AST_Constant
&& !(self.left instanceof AST_Constant)) {