()
| 5679 | var b; |
| 5680 | |
| 5681 | function doCatch() { |
| 5682 | var oldScope = scope; |
| 5683 | var e; |
| 5684 | |
| 5685 | advance("catch"); |
| 5686 | advance("("); |
| 5687 | |
| 5688 | scope = Object.create(oldScope); |
| 5689 | |
| 5690 | e = state.tokens.next.value; |
| 5691 | if (state.tokens.next.type !== "(identifier)") { |
| 5692 | e = null; |
| 5693 | warning("E030", state.tokens.next, e); |
| 5694 | } |
| 5695 | |
| 5696 | advance(); |
| 5697 | |
| 5698 | funct = functor("(catch)", state.tokens.next, scope, { |
| 5699 | "(context)" : funct, |
| 5700 | "(breakage)" : funct["(breakage)"], |
| 5701 | "(loopage)" : funct["(loopage)"], |
| 5702 | "(statement)": false, |
| 5703 | "(catch)" : true |
| 5704 | }); |
| 5705 | |
| 5706 | if (e) { |
| 5707 | addlabel(e, { type: "exception" }); |
| 5708 | } |
| 5709 | |
| 5710 | if (state.tokens.next.value === "if") { |
| 5711 | if (!state.option.inMoz(true)) { |
| 5712 | warning("W118", state.tokens.curr, "catch filter"); |
| 5713 | } |
| 5714 | advance("if"); |
| 5715 | expression(0); |
| 5716 | } |
| 5717 | |
| 5718 | advance(")"); |
| 5719 | |
| 5720 | state.tokens.curr.funct = funct; |
| 5721 | functions.push(funct); |
| 5722 | |
| 5723 | block(false); |
| 5724 | |
| 5725 | scope = oldScope; |
| 5726 | |
| 5727 | funct["(last)"] = state.tokens.curr.line; |
| 5728 | funct["(lastcharacter)"] = state.tokens.curr.character; |
| 5729 | funct = funct["(context)"]; |
| 5730 | } |
| 5731 | |
| 5732 | block(true); |
| 5733 |
no test coverage detected