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

fix: getPrototypeOf trap get called in safari #62

Merged
merged 1 commit into from
Sep 28, 2019
Merged

fix: getPrototypeOf trap get called in safari #62

merged 1 commit into from
Sep 28, 2019

Conversation

Jack-Works
Copy link
Contributor

related to #17 (comment)

Copy link
Member

@erights erights left a 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)}`);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch!

Copy link
Contributor Author

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>}
Copy link
Member

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.

Copy link
Contributor Author

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
Copy link
Member

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?

@erights erights merged commit 98516d3 into Agoric:master Sep 28, 2019
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 this pull request may close these issues.

2 participants