-
Notifications
You must be signed in to change notification settings - Fork 570
js: add MakeFullWrapper to expose exported methods and struct fields. #1112
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
Conversation
Thanks for doing the rebase! Upon the first pass the change looks good, but it is a part of the codebase I'm not very familiar with. I'll need a day or two more to understand this change in more detail. Please disregard the failed check, it appears to be a bug in the check itself, unrelated to this PR. |
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.
@JounQin sorry for the delay, I had a very busy week at work. I left a few minor comments to improve code readability. I also pushed a fix for the failed GitHub Action, if you rebase on the latest master, the check should pass.
@JounQin I'd like to merge this pull request and make a GopherJS release with it. If you need help with addressing the comments I left, you could enable "Allow edits and access to secrets by maintainers" on this PR, and I could give it a go. |
I've already enabled this feature when PR open, feel free to change. |
Strange, I get an error when I try to push commits to it:
I'll try to figure out what I'm going wrong :) |
@JounQin I figured out the issue. Your repository is a fork of https://github.com/myitcv/gopherjs, not this repository. Apparently, in GitHub's eyes this disqualifies me from being able to edit this pull request contents:
Do you need my assistance to address the review comments? I could take your branch and make yet another PR from it if so. |
Currently the documentation for js.MakeWrapper is: > "MakeWrapper creates a JavaScript object which has wrappers for the exported methods of i. Use explicit getter and setter methods to expose struct fields to JavaScript." Where the value a struct value (or more interestingly a pointer to a struct value) we can actually auto-generate getters and setters for exported fields in the JavaScript world, rather than requiring explicit getters and setters to be defined on the Go side. We do this via a new MakeFullWrapper method.
@nevkontakte Please help to review again. |
@JounQin thanks for addressing the comments, and thanks for the contribution! |
rebase for #790
close #790
Currently the documentation for js.MakeWrapper is:
Where the value a struct value (or more
interestingly a pointer to a struct value) we can actually auto-generate
getters and setters for exported fields in the JavaScript world, rather
than requiring explicit getters and setters to be defined on the Go
side.
We do this via a new MakeFullWrapper method.