(parser)
| 6151 | return { type, conversion }; |
| 6152 | } |
| 6153 | static parse(parser) { |
| 6154 | if (!parser.matchToken("fetch")) return; |
| 6155 | parser.pushFollow("as"); |
| 6156 | try { |
| 6157 | var url = parser.parseURLOrExpression(); |
| 6158 | } finally { |
| 6159 | parser.popFollow(); |
| 6160 | } |
| 6161 | if (parser.matchToken("as")) { |
| 6162 | var conversionInfo = _FetchCommand.parseConversionInfo(parser); |
| 6163 | } |
| 6164 | if (parser.matchToken("with") && parser.currentToken().value !== "{") { |
| 6165 | var argExprs = parser.parseElement("nakedNamedArgumentList"); |
| 6166 | } else { |
| 6167 | var argExprs = parser.parseElement("objectLiteral"); |
| 6168 | } |
| 6169 | if (conversionInfo == null && parser.matchToken("as")) { |
| 6170 | conversionInfo = _FetchCommand.parseConversionInfo(parser); |
| 6171 | } |
| 6172 | var dontThrow = false; |
| 6173 | if (parser.matchToken("do")) { |
| 6174 | parser.requireToken("not"); |
| 6175 | parser.requireToken("throw"); |
| 6176 | dontThrow = true; |
| 6177 | } else if (parser.currentToken().value === "don" && parser.token(1).value === "'" && parser.token(2).value === "t" && parser.token(1).start === parser.currentToken().end && parser.token(2).start === parser.token(1).end) { |
| 6178 | parser.consumeToken(); |
| 6179 | parser.consumeToken(); |
| 6180 | parser.consumeToken(); |
| 6181 | parser.requireToken("throw"); |
| 6182 | dontThrow = true; |
| 6183 | } |
| 6184 | var type = conversionInfo ? conversionInfo.type : "text"; |
| 6185 | var conversion = conversionInfo ? conversionInfo.conversion : null; |
| 6186 | return new _FetchCommand(url, argExprs, type, conversion, dontThrow); |
| 6187 | } |
| 6188 | resolve(context, { url, options }) { |
| 6189 | var detail = options || {}; |
| 6190 | detail.sender = context.me; |
nothing calls this directly
no test coverage detected