()
| 3677 | } |
| 3678 | |
| 3679 | function statement() { |
| 3680 | var values; |
| 3681 | var i = indent, r, s = scope, t = state.tokens.next; |
| 3682 | |
| 3683 | if (t.id === ";") { |
| 3684 | advance(";"); |
| 3685 | return; |
| 3686 | } |
| 3687 | var res = isReserved(t); |
| 3688 | |
| 3689 | if (res && t.meta && t.meta.isFutureReservedWord && peek().id === ":") { |
| 3690 | warning("W024", t, t.id); |
| 3691 | res = false; |
| 3692 | } |
| 3693 | if (t.value === "module" && t.type === "(identifier)") { |
| 3694 | if (peek().type === "(identifier)") { |
| 3695 | if (!state.option.inESNext()) { |
| 3696 | warning("W119", state.tokens.curr, "module"); |
| 3697 | } |
| 3698 | |
| 3699 | advance("module"); |
| 3700 | var name = identifier(); |
| 3701 | addlabel(name, { type: "unused", token: state.tokens.curr }); |
| 3702 | advance("from"); |
| 3703 | advance("(string)"); |
| 3704 | parseFinalSemicolon(); |
| 3705 | return; |
| 3706 | } |
| 3707 | } |
| 3708 | if (_.has(["[", "{"], t.value)) { |
| 3709 | if (lookupBlockType().isDestAssign) { |
| 3710 | if (!state.option.inESNext()) { |
| 3711 | warning("W104", state.tokens.curr, "destructuring expression"); |
| 3712 | } |
| 3713 | values = destructuringExpression(); |
| 3714 | values.forEach(function (tok) { |
| 3715 | isundef(funct, "W117", tok.token, tok.id); |
| 3716 | }); |
| 3717 | advance("="); |
| 3718 | destructuringExpressionMatch(values, expression(10, true)); |
| 3719 | advance(";"); |
| 3720 | return; |
| 3721 | } |
| 3722 | } |
| 3723 | if (t.identifier && !res && peek().id === ":") { |
| 3724 | advance(); |
| 3725 | advance(":"); |
| 3726 | scope = Object.create(s); |
| 3727 | addlabel(t.value, { type: "label" }); |
| 3728 | |
| 3729 | if (!state.tokens.next.labelled && state.tokens.next.value !== "{") { |
| 3730 | warning("W028", state.tokens.next, t.value, state.tokens.next.value); |
| 3731 | } |
| 3732 | |
| 3733 | state.tokens.next.label = t.value; |
| 3734 | t = state.tokens.next; |
| 3735 | } |
| 3736 |
no test coverage detected