Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Symbol.toStringTag is missing on File, Blob and FormData #1641

Open
octet-stream opened this issue Nov 3, 2023 · 2 comments · May be fixed by #1699
Open

Symbol.toStringTag is missing on File, Blob and FormData #1641

octet-stream opened this issue Nov 3, 2023 · 2 comments · May be fixed by #1699

Comments

@octet-stream
Copy link

Hi. I have discovered that Symbol.toStringTag is missing on File, Blob and FormData which causes compatibility issues for my library, which implements FormData and few other interfaces for Node. Some people still using it and they have this kind of issue, when they need to use it with fetch API. You can find more information here: octet-stream/form-data#57

This symbol is present in every implementation I've tested: Chrome v118.0.5993.117, Safari v17.1, Firefox v116.0.3, Deno v1.37.2, Node v21.1.0 (which inherits its implementation from undici), and Bun v1.0.8. I think this symbol should be present in types as well.

For more context: I also use this property for Symbol.hasInstance checks in my FormData, File and Blob implementations to verify if given value is an object that implements compatible API for these interfaces.

@saschanaz
Copy link
Contributor

Per the spec it should exist for every Web IDL interface: https://webidl.spec.whatwg.org/#ref-for-dfn-class-string

PR welcome.

@jdufresne
Copy link

Per the spec it should exist for every Web IDL interface: https://webidl.spec.whatwg.org/#ref-for-dfn-class-string

@saschanaz Could you provide some guidance on how to approach this issue with the provided information?

Without knowing better, my first instinct would be to add this property to inputfiles/overridingTypes.jsonc, but your statement leads me to believe you're expecting something more.

Thanks.

jdufresne added a commit to jdufresne/TypeScript-DOM-lib-generator that referenced this issue Mar 20, 2024
jdufresne added a commit to jdufresne/TypeScript-DOM-lib-generator that referenced this issue Mar 20, 2024
jdufresne added a commit to jdufresne/TypeScript-DOM-lib-generator that referenced this issue Mar 20, 2024
@jdufresne jdufresne linked a pull request Mar 20, 2024 that will close this issue
jdufresne added a commit to jdufresne/TypeScript-DOM-lib-generator that referenced this issue Mar 24, 2024
jdufresne added a commit to jdufresne/TypeScript-DOM-lib-generator that referenced this issue Mar 27, 2024
jdufresne added a commit to jdufresne/TypeScript-DOM-lib-generator that referenced this issue Mar 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants