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

refactor: Use ProxyCreate to remove setTimeout #72

Merged
merged 1 commit into from
Jul 2, 2020

Conversation

ExE-Boss
Copy link
Contributor

@ExE-Boss ExE-Boss commented Jul 1, 2020

Since #67 made it so that the value of this is irrelevant after the newTarget check, this moves the proxy construction into a ProxyCreate helper function, which is based on the ProxyCreate abstract operation, but takes an additional allowRevocation parameter, which is used to conditionally create the revoke function only when necessary, which also follows the spec more closely.


It also fixes the issue listed in:

// Construct revoke function, and set lastRevokeFn so that Proxy.revocable can steal it.
// The caller might get the wrong revoke function if a user replaces or wraps scope.Proxy
// to call itself, but that seems unlikely especially when using the polyfill.

Copy link
Contributor

@samthor samthor left a comment

Choose a reason for hiding this comment

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

Thanks, this is much nicer.

@samthor samthor merged commit f667dd4 into GoogleChrome:master Jul 2, 2020
@ExE-Boss ExE-Boss deleted the refactor/use-proxy-create branch July 2, 2020 02:31
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