summaryrefslogtreecommitdiffstats
path: root/js/src/frontend/FoldConstants.cpp
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@wolfbeast.com>2020-02-27 20:09:26 +0100
committerwolfbeast <mcwerewolf@wolfbeast.com>2020-04-14 13:00:11 +0200
commite7841ab5d740eb70f2975212de4a1066d8714438 (patch)
treed699b22a0de4ab35e953c6fe205c90374956b30b /js/src/frontend/FoldConstants.cpp
parentdba09fa5c43276bb455cc4da6bd0ec302f798189 (diff)
downloadUXP-e7841ab5d740eb70f2975212de4a1066d8714438.tar
UXP-e7841ab5d740eb70f2975212de4a1066d8714438.tar.gz
UXP-e7841ab5d740eb70f2975212de4a1066d8714438.tar.lz
UXP-e7841ab5d740eb70f2975212de4a1066d8714438.tar.xz
UXP-e7841ab5d740eb70f2975212de4a1066d8714438.zip
Issue #1465 - Implement optional catch binding.
Diffstat (limited to 'js/src/frontend/FoldConstants.cpp')
-rw-r--r--js/src/frontend/FoldConstants.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/js/src/frontend/FoldConstants.cpp b/js/src/frontend/FoldConstants.cpp
index 16294c4a8..b460b92b6 100644
--- a/js/src/frontend/FoldConstants.cpp
+++ b/js/src/frontend/FoldConstants.cpp
@@ -1260,9 +1260,10 @@ FoldCatch(ExclusiveContext* cx, ParseNode* node, Parser<FullParseHandler>& parse
MOZ_ASSERT(node->isKind(PNK_CATCH));
MOZ_ASSERT(node->isArity(PN_TERNARY));
- ParseNode*& declPattern = node->pn_kid1;
- if (!Fold(cx, &declPattern, parser, inGenexpLambda))
- return false;
+ if (ParseNode*& declPattern = node->pn_kid1) {
+ if (!Fold(cx, &declPattern, parser, inGenexpLambda))
+ return false;
+ }
if (ParseNode*& cond = node->pn_kid2) {
if (!FoldCondition(cx, &cond, parser, inGenexpLambda))