(requests)
| 87 | } |
| 88 | |
| 89 | async addAll (requests) { |
| 90 | webidl.brandCheck(this, Cache) |
| 91 | |
| 92 | const prefix = 'Cache.addAll' |
| 93 | webidl.argumentLengthCheck(arguments, 1, prefix) |
| 94 | |
| 95 | // 1. |
| 96 | const responsePromises = [] |
| 97 | |
| 98 | // 2. |
| 99 | const requestList = [] |
| 100 | |
| 101 | // 3. |
| 102 | for (let request of requests) { |
| 103 | if (request === undefined) { |
| 104 | throw webidl.errors.conversionFailed({ |
| 105 | prefix, |
| 106 | argument: 'Argument 1', |
| 107 | types: ['undefined is not allowed'] |
| 108 | }) |
| 109 | } |
| 110 | |
| 111 | request = webidl.converters.RequestInfo(request) |
| 112 | |
| 113 | if (typeof request === 'string') { |
| 114 | continue |
| 115 | } |
| 116 | |
| 117 | // 3.1 |
| 118 | const r = getRequestState(request) |
| 119 | |
| 120 | // 3.2 |
| 121 | if (!urlIsHttpHttpsScheme(r.url) || r.method !== 'GET') { |
| 122 | throw webidl.errors.exception({ |
| 123 | header: prefix, |
| 124 | message: 'Expected http/s scheme when method is not GET.' |
| 125 | }) |
| 126 | } |
| 127 | } |
| 128 | |
| 129 | // 4. |
| 130 | /** @type {ReturnType<typeof fetching>[]} */ |
| 131 | const fetchControllers = [] |
| 132 | |
| 133 | // 5. |
| 134 | for (const request of requests) { |
| 135 | // 5.1 |
| 136 | const r = getRequestState(new Request(request)) |
| 137 | |
| 138 | // 5.2 |
| 139 | if (!urlIsHttpHttpsScheme(r.url)) { |
| 140 | throw webidl.errors.exception({ |
| 141 | header: prefix, |
| 142 | message: 'Expected http/s scheme.' |
| 143 | }) |
| 144 | } |
| 145 | |
| 146 | // 5.4 |
no test coverage detected