summaryrefslogtreecommitdiffstats
path: root/js/src/frontend/ParseNode.cpp
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@wolfbeast.com>2020-02-27 20:09:26 +0100
committerwolfbeast <mcwerewolf@wolfbeast.com>2020-02-27 20:09:26 +0100
commitae8eb4d4c42d96c264d5036e1c50e8c1d0d55425 (patch)
tree061997488fc462caeae817e6547d3a30351c8a8d /js/src/frontend/ParseNode.cpp
parent793da7dd6238ce156e29c71304e24b2c05edc11d (diff)
downloadUXP-ae8eb4d4c42d96c264d5036e1c50e8c1d0d55425.tar
UXP-ae8eb4d4c42d96c264d5036e1c50e8c1d0d55425.tar.gz
UXP-ae8eb4d4c42d96c264d5036e1c50e8c1d0d55425.tar.lz
UXP-ae8eb4d4c42d96c264d5036e1c50e8c1d0d55425.tar.xz
UXP-ae8eb4d4c42d96c264d5036e1c50e8c1d0d55425.zip
Issue #1465 - Implement optional catch binding.
Diffstat (limited to 'js/src/frontend/ParseNode.cpp')
-rw-r--r--js/src/frontend/ParseNode.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/js/src/frontend/ParseNode.cpp b/js/src/frontend/ParseNode.cpp
index 42ae9451a..e01a41067 100644
--- a/js/src/frontend/ParseNode.cpp
+++ b/js/src/frontend/ParseNode.cpp
@@ -409,13 +409,14 @@ PushNodeChildren(ParseNode* pn, NodeStack* stack)
return PushResult::Recyclable;
}
- // A catch node has first kid as catch-variable pattern, the second kid
- // as catch condition (which, if non-null, records the |<cond>| in
- // SpiderMonkey's |catch (e if <cond>)| extension), and third kid as the
- // statements in the catch block.
+ // A catch node has an (optional) first kid as catch-variable pattern,
+ // the second kid as (optional) catch condition (which, records the
+ // |<cond>| in SpiderMonkey's |catch (e if <cond>)| extension), and
+ // third kid as the statements in the catch block.
case PNK_CATCH: {
MOZ_ASSERT(pn->isArity(PN_TERNARY));
- stack->push(pn->pn_kid1);
+ if (pn->pn_kid1)
+ stack->push(pn->pn_kid1);
if (pn->pn_kid2)
stack->push(pn->pn_kid2);
stack->push(pn->pn_kid3);