aboutsummaryrefslogtreecommitdiff
path: root/lib/ast.js
diff options
context:
space:
mode:
authorMihai Bazon <mihai@bazon.net>2013-06-07 12:51:23 +0300
committerMihai Bazon <mihai@bazon.net>2013-06-07 12:52:09 +0300
commit02a84385a02ccf4cf3a1ccca2fc5f6a90fb43487 (patch)
tree78a557ba0c74875603b20f4b2255f4dac48d37a4 /lib/ast.js
parenta4889a0f2e4c5939bcda7d527843c8bf3bdedc81 (diff)
downloadtracifyjs-02a84385a02ccf4cf3a1ccca2fc5f6a90fb43487.tar.gz
tracifyjs-02a84385a02ccf4cf3a1ccca2fc5f6a90fb43487.zip
Don't swap binary ops when "use asm" is in effect.
Refs #167
Diffstat (limited to 'lib/ast.js')
-rw-r--r--lib/ast.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/ast.js b/lib/ast.js
index a1301da8..b8e89f23 100644
--- a/lib/ast.js
+++ b/lib/ast.js
@@ -945,6 +945,9 @@ TreeWalker.prototype = {
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];