-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Remove Object.setPrototypeOf() #3306
Conversation
Object.setPrototypeOf() doesn't work on Android
Generated by 🚫 dangerJS |
This LGTM for compatibility purposes. In a future PR, when should reconsider setting the prototype directly as it will cause JITs to deoptimize. |
@seklyza can you resolve your conflicts and then merge the PR, please?? |
Is this going to get cleaned up and merged? Only conflict is CHANGELOG.md |
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 submitting this PR @seklyza! I think we're almost ready to go here. I'll take care of the review items, and we'll plan on getting this merged shortly. Thanks!
# Change log | ||
|
||
### vNext | ||
|
||
- Fixed an issue involving `Object.setPrototypeOf()` not working on JSC |
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've adjusted the comment here to be a bit more descriptive.
@@ -65,6 +65,6 @@ export class ApolloError extends Error { | |||
|
|||
this.extraInfo = extraInfo; | |||
|
|||
Object.setPrototypeOf(this, ApolloError.prototype); | |||
(this as any).__proto__ = ApolloError.prototype; |
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 think we should add a comment here explaining why we aren't using Object.setPrototypeOf
. Otherwise someone might add it back in the future.
Fixes #3236
Object.setPrototypeOf()
does not work on JSC (Android). Instead, we're setting the prototype ofthis
manually.