()
| 5985 | var b; |
| 5986 | |
| 5987 | function doCatch() { |
| 5988 | var oldScope = scope; |
| 5989 | var e; |
| 5990 | |
| 5991 | advance("catch"); |
| 5992 | advance("("); |
| 5993 | |
| 5994 | scope = Object.create(oldScope); |
| 5995 | |
| 5996 | e = state.tokens.next.value; |
| 5997 | if (state.tokens.next.type !== "(identifier)") { |
| 5998 | e = null; |
| 5999 | warning("E030", state.tokens.next, e); |
| 6000 | } |
| 6001 | |
| 6002 | advance(); |
| 6003 | |
| 6004 | funct = functor("(catch)", state.tokens.next, scope, { |
| 6005 | "(context)" : funct, |
| 6006 | "(breakage)" : funct["(breakage)"], |
| 6007 | "(loopage)" : funct["(loopage)"], |
| 6008 | "(statement)": false, |
| 6009 | "(catch)" : true |
| 6010 | }); |
| 6011 | |
| 6012 | if (e) { |
| 6013 | addlabel(e, { type: "exception" }); |
| 6014 | } |
| 6015 | |
| 6016 | if (state.tokens.next.value === "if") { |
| 6017 | if (!state.option.inMoz(true)) { |
| 6018 | warning("W118", state.tokens.curr, "catch filter"); |
| 6019 | } |
| 6020 | advance("if"); |
| 6021 | expression(0); |
| 6022 | } |
| 6023 | |
| 6024 | advance(")"); |
| 6025 | |
| 6026 | state.tokens.curr.funct = funct; |
| 6027 | functions.push(funct); |
| 6028 | |
| 6029 | block(false); |
| 6030 | |
| 6031 | scope = oldScope; |
| 6032 | |
| 6033 | funct["(last)"] = state.tokens.curr.line; |
| 6034 | funct["(lastcharacter)"] = state.tokens.curr.character; |
| 6035 | funct = funct["(context)"]; |
| 6036 | } |
| 6037 | |
| 6038 | block(true); |
| 6039 |
no test coverage detected