()
| 22940 | var b; |
| 22941 | |
| 22942 | function doCatch() { |
| 22943 | advance("catch"); |
| 22944 | advance("("); |
| 22945 | |
| 22946 | state.funct["(scope)"].stack("catchparams"); |
| 22947 | |
| 22948 | if (checkPunctuators(state.tokens.next, ["[", "{"])) { |
| 22949 | var tokens = destructuringPattern(); |
| 22950 | _.each(tokens, function(token) { |
| 22951 | if (token.id) { |
| 22952 | state.funct["(scope)"].addParam(token.id, token, "exception"); |
| 22953 | } |
| 22954 | }); |
| 22955 | } else if (state.tokens.next.type !== "(identifier)") { |
| 22956 | warning("E030", state.tokens.next, state.tokens.next.value); |
| 22957 | } else { |
| 22958 | // only advance if we have an identifier so we can continue parsing in the most common error - that no param is given. |
| 22959 | state.funct["(scope)"].addParam(identifier(), state.tokens.curr, "exception"); |
| 22960 | } |
| 22961 | |
| 22962 | if (state.tokens.next.value === "if") { |
| 22963 | if (!state.inMoz()) { |
| 22964 | warning("W118", state.tokens.curr, "catch filter"); |
| 22965 | } |
| 22966 | advance("if"); |
| 22967 | expression(0); |
| 22968 | } |
| 22969 | |
| 22970 | advance(")"); |
| 22971 | |
| 22972 | block(false); |
| 22973 | |
| 22974 | state.funct["(scope)"].unstack(); |
| 22975 | } |
| 22976 | |
| 22977 | block(true); |
| 22978 |
no test coverage detected