aboutsummaryrefslogtreecommitdiff
path: root/src/parseTools.js
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2011-11-18 18:33:07 -0800
committerAlon Zakai <alonzakai@gmail.com>2011-11-18 18:33:07 -0800
commit6fe6d4c2e43a7b2637c9cace06c7ef3f21018f0d (patch)
tree353d6f65de0b0c44f2fe88a96bb10231b931b69c /src/parseTools.js
parentfbfbdba4bf1913fe0a97d1e3ca5b1c14a38c8964 (diff)
cleverer dependency resolving in phis
Diffstat (limited to 'src/parseTools.js')
-rw-r--r--src/parseTools.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/parseTools.js b/src/parseTools.js
index e3734e0e..07855c70 100644
--- a/src/parseTools.js
+++ b/src/parseTools.js
@@ -1692,9 +1692,9 @@ function processMathop(item) { with(item) {
// TODO: Use this in analyzer, possibly also in jsifier
function walkInterdata(item, pre, post, obj) {
if (!item || !item.intertype) return false;
- if (pre(item, obj)) return true;
+ if (pre && pre(item, obj)) return true;
var originalObj = obj;
- if (obj.replaceWith) obj = obj.replaceWith; // allow pre to replace the object we pass to all its children
+ if (obj && obj.replaceWith) obj = obj.replaceWith; // allow pre to replace the object we pass to all its children
if (item.value && walkInterdata(item.value, pre, post, obj)) return true;
var i;
for (i = 1; i <= 4; i++) {
@@ -1712,7 +1712,7 @@ function walkInterdata(item, pre, post, obj) {
if (walkInterdata(box, pre, post, obj)) return true;
}
}
- return post(item, originalObj, obj);
+ return post && post(item, originalObj, obj);
}
function parseBlockAddress(segment) {