Commit c95b0bc
fix: support objects with null prototype as
Currently, if an object is created with the null prototype, e.g.
```typescript
const headers = Object.create(null);
```
attempting to instantiate a `Headers` object with this polyfill throws
an error:
```
TypeError: Cannot read properties of undefined (reading 'name')
```
because `headers.constructor` is undefined.
@kettanaito
---------
Co-authored-by: Artem Zakharchenko <kettanaito@gmail.com>HeadersInit (#81)1 parent 170cec2 commit c95b0bc
2 files changed
Lines changed: 8 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
43 | 50 | | |
44 | 51 | | |
45 | 52 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
| 28 | + | |
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| |||
0 commit comments