MCPcopy Create free account
hub / github.com/nodejs/node / constructor

Method constructor

deps/undici/src/lib/web/fetch/headers.js:438–457  ·  view source on GitHub ↗

* @param {HeadersInit|Symbol} [init] * @returns

(init = undefined)

Source from the content-addressed store, hash-verified

436 * @returns
437 */
438 constructor (init = undefined) {
439 webidl.util.markAsUncloneable(this)
440
441 if (init === kConstruct) {
442 return
443 }
444
445 this.#headersList = new HeadersList()
446
447 // The new Headers(init) constructor steps are:
448
449 // 1. Set this’s guard to "none".
450 this.#guard = 'none'
451
452 // 2. If init is given, then fill this with init.
453 if (init !== undefined) {
454 init = webidl.converters.HeadersInit(init, 'Headers constructor', 'init')
455 fill(this, init)
456 }
457 }
458
459 // https://fetch.spec.whatwg.org/#dom-headers-append
460 append (name, value) {

Callers

nothing calls this directly

Calls 2

markAsUncloneableMethod · 0.80
fillFunction · 0.70

Tested by

no test coverage detected