nodejs/node

FormData, Response, Request, and Headers have incorrect property descriptors

Open

#45,099 opened on Oct 20, 2022

View on GitHub
 (7 comments) (1 reaction) (0 assignees)JavaScript (35,535 forks)batch import
confirmed-bughelp wanted

Repository metrics

Stars
 (117,218 stars)
PR merge metrics
 (Avg merge 13d 4h) (233 merged PRs in 30d)

Description

Version

v18.11.0

Platform

Microsoft Windows NT 10.0.19043.0 x64

Subsystem

No response

What steps will reproduce the bug?

The property descriptors should match such that this test succeeds:


for (const global of [
  'Headers',
  'Request',
  'Response',
  'FormData'
]) {
  const desc = Object.getOwnPropertyDescriptor(globalThis, global)
  
  assert.notStrictEqual(desc, undefined)
  assert.deepStrictEqual(desc.value, globalThis[global])
  assert.ok(desc.writable)
  assert.ok(!desc.enumerable)
  assert.ok(desc.configurable)
}

How often does it reproduce? Is there a required condition?

No response

What is the expected behavior?

the tests from above pass

What do you see instead?

the descriptors are inconsistent with other environments

Additional information

No response

Contributor guide