(parser)
| 5805 | return { type, conversion }; |
| 5806 | } |
| 5807 | static parse(parser) { |
| 5808 | if (!parser.matchToken("fetch")) return; |
| 5809 | var url = parser.parseURLOrExpression(); |
| 5810 | if (parser.matchToken("as")) { |
| 5811 | var conversionInfo = _FetchCommand.parseConversionInfo(parser); |
| 5812 | } |
| 5813 | if (parser.matchToken("with") && parser.currentToken().value !== "{") { |
| 5814 | var argExprs = parser.parseElement("nakedNamedArgumentList"); |
| 5815 | } else { |
| 5816 | var argExprs = parser.parseElement("objectLiteral"); |
| 5817 | } |
| 5818 | if (conversionInfo == null && parser.matchToken("as")) { |
| 5819 | conversionInfo = _FetchCommand.parseConversionInfo(parser); |
| 5820 | } |
| 5821 | var dontThrow = false; |
| 5822 | if (parser.matchToken("do")) { |
| 5823 | parser.requireToken("not"); |
| 5824 | parser.requireToken("throw"); |
| 5825 | dontThrow = true; |
| 5826 | } 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) { |
| 5827 | parser.consumeToken(); |
| 5828 | parser.consumeToken(); |
| 5829 | parser.consumeToken(); |
| 5830 | parser.requireToken("throw"); |
| 5831 | dontThrow = true; |
| 5832 | } |
| 5833 | var type = conversionInfo ? conversionInfo.type : "text"; |
| 5834 | var conversion = conversionInfo ? conversionInfo.conversion : null; |
| 5835 | return new _FetchCommand(url, argExprs, type, conversion, dontThrow); |
| 5836 | } |
| 5837 | resolve(context, { url, options }) { |
| 5838 | var detail = options || {}; |
| 5839 | detail.sender = context.me; |
nothing calls this directly
no test coverage detected