MCPcopy Create free account
hub / github.com/angular/dev-infra / constructor

Method constructor

github-actions/browserstack/set-browserstack-env.js:13158–13436  ·  view source on GitHub ↗
(input, init = {})

Source from the content-addressed store, hash-verified

13156 const response = new Response(kConstruct);
13157 response[kState] = innerResponse;
13158 response[kHeaders] = new Headers2(kConstruct);
13159 setHeadersList(response[kHeaders], innerResponse.headersList);
13160 setHeadersGuard(response[kHeaders], guard);
13161 if (hasFinalizationRegistry && ((_a = innerResponse.body) == null ? void 0 : _a.stream)) {
13162 streamRegistry.register(response, new WeakRef(innerResponse.body.stream));
13163 }
13164 return response;
13165 }
13166 webidl.converters.ReadableStream = webidl.interfaceConverter(
13167 ReadableStream
13168 );
13169 webidl.converters.FormData = webidl.interfaceConverter(
13170 FormData
13171 );
13172 webidl.converters.URLSearchParams = webidl.interfaceConverter(
13173 URLSearchParams
13174 );
13175 webidl.converters.XMLHttpRequestBodyInit = function(V, prefix, name) {
13176 if (typeof V === "string") {
13177 return webidl.converters.USVString(V, prefix, name);
13178 }
13179 if (isBlobLike(V)) {
13180 return webidl.converters.Blob(V, prefix, name, { strict: false });
13181 }
13182 if (ArrayBuffer.isView(V) || types.isArrayBuffer(V)) {
13183 return webidl.converters.BufferSource(V, prefix, name);
13184 }
13185 if (util.isFormDataLike(V)) {
13186 return webidl.converters.FormData(V, prefix, name, { strict: false });
13187 }
13188 if (V instanceof URLSearchParams) {
13189 return webidl.converters.URLSearchParams(V, prefix, name);
13190 }
13191 return webidl.converters.DOMString(V, prefix, name);
13192 };
13193 webidl.converters.BodyInit = function(V, prefix, argument) {
13194 if (V instanceof ReadableStream) {
13195 return webidl.converters.ReadableStream(V, prefix, argument);
13196 }
13197 if (V == null ? void 0 : V[Symbol.asyncIterator]) {
13198 return V;
13199 }
13200 return webidl.converters.XMLHttpRequestBodyInit(V, prefix, argument);
13201 };
13202 webidl.converters.ResponseInit = webidl.dictionaryConverter([
13203 {
13204 key: "status",
13205 converter: webidl.converters["unsigned short"],
13206 defaultValue: () => 200
13207 },
13208 {
13209 key: "statusText",
13210 converter: webidl.converters.ByteString,
13211 defaultValue: () => ""
13212 },
13213 {
13214 key: "headers",
13215 converter: webidl.converters.HeadersInit

Callers

nothing calls this directly

Calls 14

makeRequestFunction · 0.70
sameOriginFunction · 0.70
isValidHTTPTokenFunction · 0.70
buildAbortFunction · 0.70
extractBodyFunction · 0.70
bodyUnusableFunction · 0.70
keysMethod · 0.45
hasMethod · 0.45
abortMethod · 0.45
registerMethod · 0.45
clearMethod · 0.45
rawValuesMethod · 0.45

Tested by

no test coverage detected