-
Notifications
You must be signed in to change notification settings - Fork 303
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
Add cloudflare internal symbol to resourcetypes #2801
Add cloudflare internal symbol to resourcetypes #2801
Conversation
Miniflare has been using the lack of `Symbol.toStringTag` to detect internal API objects. This is brittle and problematic because for compliance with standard web platform APIs we're supposed to be adding the Symbol.toStringTag to standard types and there are modules in the ecosystem that depend on it. We recently landed a change that adds the Symbol.toStringTag to types but that broke miniflare. This PR adds an alternative symbol to jsg::Objects that can identify themselves as internal.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Could you use the existing workerd/src/workerd/jsg/resource.h Line 920 in b45d297
workerd/src/node/internal/internal_inspect.ts Line 1101 in b45d297
|
Possibly but I think for the sake of time since we need this to unblock something for release tomorrow this is better. Keep in mind that |
Miniflare has been using the lack of
Symbol.toStringTag
to detect internal API objects. This is brittle and problematic because for compliance with standard web platform APIs we're supposed to be adding the Symbol.toStringTag to standard types and there are modules in the ecosystem that depend on it. We recently landed a change that adds the Symbol.toStringTag to types but that broke miniflare. This PR adds an alternative symbol to jsg::Objects that can identify themselves as internal.