-
Notifications
You must be signed in to change notification settings - Fork 19
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
fix: getPrototypeOf trap get called in safari #62
Conversation
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.
Thanks!
@@ -8,7 +8,7 @@ import { throwTantrum } from './utilities'; | |||
*/ | |||
const alwaysThrowHandler = new Proxy(freeze({}), { | |||
get(target, prop) { | |||
throwTantrum(`unexpected scope handler trap called: ${prop}`); | |||
throwTantrum(`unexpected scope handler trap called: ${String(prop)}`); |
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.
Good catch!
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.
It's Typescript language server warned me about this.
@@ -25,6 +25,8 @@ const alwaysThrowHandler = new Proxy(freeze({}), { | |||
* - route all other property lookups at the safeGlobal. | |||
* - hide the unsafeGlobal which lives on the scope chain above the 'with'. | |||
* - ensure the Proxy invariants despite some global properties being frozen. | |||
* | |||
* @returns {ProxyHandler<any> & Record<string, any>} |
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.
I never did learn this comment-type language, so I can't review whether this declaration is good. Since it is in a comment, I won't block a merge here on my own ignorance.
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.
It's using jsdoc-like syntax to hint ts server about the type of the function
@@ -79,7 +81,6 @@ export function createScopeHandler(unsafeRec, safeGlobal, sloppyGlobals) { | |||
return undefined; | |||
}, | |||
|
|||
// eslint-disable-next-line class-methods-use-this |
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.
Thanks for catching this. Does anyone have an automated detection of eslint-disables-*
s that are not actually suppressing any warnings?
related to #17 (comment)