Lines Matching refs:init

53   static json (data, init = {}) {
56 if (init !== null) {
57 init = webidl.converters.ResponseInit(init)
76 // 4. Perform initialize a response given responseObject, init, and (body, "application/json").
77 initializeResponse(responseObject, init, { body: body[0], type: 'application/json' })
131 constructor (body = null, init = {}) {
136 init = webidl.converters.ResponseInit(init)
161 // 5. Perform initialize a response given this, init, and bodyWithType.
162 initializeResponse(this, init, bodyWithType)
326 function makeResponse (init) {
337 ...init,
338 headersList: init.headersList
339 ? new HeadersList(init.headersList)
341 urlList: init.urlList ? [...init.urlList] : []
442 function initializeResponse (response, init, body) {
443 // 1. If init["status"] is not in the range 200 to 599, inclusive, then
445 if (init.status !== null && (init.status < 200 || init.status > 599)) {
446 throw new RangeError('init["status"] must be in the range of 200 to 599, inclusive.')
449 // 2. If init["statusText"] does not match the reason-phrase token production,
451 if ('statusText' in init && init.statusText != null) {
454 if (!isValidReasonPhrase(String(init.statusText))) {
459 // 3. Set response’s response’s status to init["status"].
460 if ('status' in init && init.status != null) {
461 response[kState].status = init.status
464 // 4. Set response’s response’s status message to init["statusText"].
465 if ('statusText' in init && init.statusText != null) {
466 response[kState].statusText = init.statusText
469 // 5. If init["headers"] exists, then fill response’s headers with init["headers"].
470 if ('headers' in init && init.headers != null) {
471 fill(response[kHeaders], init.headers)