Skip to content

Commit 840e5a0

Browse files
author
Nicolas Lefebvre
committed
fix yui#203 Failure on promise catch
1 parent 3ba356f commit 840e5a0

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/org/mozilla/javascript/Parser.java

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1970,7 +1970,18 @@ private Node memberExprTail(boolean allowCallSyntax, Node pn)
19701970

19711971
tt = nextToken();
19721972
switch (tt) {
1973-
1973+
// handle promise.catch()
1974+
case Token.CATCH:
1975+
decompiler.addName("catch");
1976+
pn = propertyName(pn, "catch", memberTypeFlags);
1977+
break;
1978+
1979+
// handle promise.finally()
1980+
case Token.FINALLY:
1981+
decompiler.addName("finally");
1982+
pn = propertyName(pn, "finally", memberTypeFlags);
1983+
break;
1984+
19741985
// needed for generator.throw();
19751986
case Token.THROW:
19761987
decompiler.addName("throw");

0 commit comments

Comments
 (0)