forked from nodejs/undici
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(fetch): set Symbol.toStringTag properly on classes (nodejs#1742)
- Loading branch information
1 parent
e27009a
commit 0c82421
Showing
6 changed files
with
56 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
'use strict' | ||
|
||
const { test } = require('tap') | ||
const { | ||
File, | ||
FormData, | ||
Headers, | ||
Request, | ||
Response | ||
} = require('../../index') | ||
|
||
test('Symbol.toStringTag descriptor', (t) => { | ||
for (const cls of [ | ||
File, | ||
FormData, | ||
Headers, | ||
Request, | ||
Response | ||
]) { | ||
const desc = Object.getOwnPropertyDescriptor(cls.prototype, Symbol.toStringTag) | ||
t.same(desc, { | ||
value: cls.name, | ||
writable: false, | ||
enumerable: false, | ||
configurable: true | ||
}) | ||
} | ||
|
||
t.end() | ||
}) |