()
| 3849 | } |
| 3850 | |
| 3851 | function statement() { |
| 3852 | var i = indent, r, s = scope, t = state.tokens.next; |
| 3853 | |
| 3854 | if (t.id === ";") { |
| 3855 | advance(";"); |
| 3856 | return; |
| 3857 | } |
| 3858 | var res = isReserved(t); |
| 3859 | |
| 3860 | if (res && t.meta && t.meta.isFutureReservedWord && peek().id === ":") { |
| 3861 | warning("W024", t, t.id); |
| 3862 | res = false; |
| 3863 | } |
| 3864 | if (t.value === "module" && t.type === "(identifier)") { |
| 3865 | if (peek().type === "(identifier)") { |
| 3866 | if (!state.option.inESNext()) { |
| 3867 | warning("W119", state.tokens.curr, "module"); |
| 3868 | } |
| 3869 | |
| 3870 | advance("module"); |
| 3871 | var name = identifier(); |
| 3872 | addlabel(name, { type: "unused", token: state.tokens.curr }); |
| 3873 | advance("from"); |
| 3874 | advance("(string)"); |
| 3875 | parseFinalSemicolon(); |
| 3876 | return; |
| 3877 | } |
| 3878 | } |
| 3879 | |
| 3880 | if (t.identifier && !res && peek().id === ":") { |
| 3881 | advance(); |
| 3882 | advance(":"); |
| 3883 | scope = Object.create(s); |
| 3884 | addlabel(t.value, { type: "label" }); |
| 3885 | |
| 3886 | if (!state.tokens.next.labelled && state.tokens.next.value !== "{") { |
| 3887 | warning("W028", state.tokens.next, t.value, state.tokens.next.value); |
| 3888 | } |
| 3889 | |
| 3890 | state.tokens.next.label = t.value; |
| 3891 | t = state.tokens.next; |
| 3892 | } |
| 3893 | |
| 3894 | if (t.id === "{") { |
| 3895 | var iscase = (funct["(verb)"] === "case" && state.tokens.curr.value === ":"); |
| 3896 | block(true, true, false, false, iscase); |
| 3897 | return; |
| 3898 | } |
| 3899 | |
| 3900 | r = expression(0, true); |
| 3901 | |
| 3902 | if (r && (!r.identifier || r.value !== "function") && (r.type !== "(punctuator)")) { |
| 3903 | if (!state.directive["use strict"] && |
| 3904 | state.option.globalstrict && |
| 3905 | state.option.strict) { |
| 3906 | warning("E007"); |
| 3907 | } |
| 3908 | } |
no test coverage detected