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

Escape certain reserved terms when building member functions #165

Merged
merged 2 commits into from
Aug 11, 2023

Conversation

Shaptic
Copy link
Contributor

@Shaptic Shaptic commented Aug 10, 2023

Closes #153.

Note: I'm still testing the end-to-end with js-stellar-base.

Copy link

@tsachiherman tsachiherman left a comment

Choose a reason for hiding this comment

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

I think that at some point we'd need to extend that to all the js reserved words, but at this point in time, the fix looks as if it would produce a good workaround.

@Shaptic
Copy link
Contributor Author

Shaptic commented Aug 10, 2023

@tsachiherman it's not that set is reserved by JS (it isn't), it's that set is a method used internally by js-xdr to actually build the structures. Thus, having an actual member named set overwrites that, making it impossible to, well, actually set fields.

@tsachiherman
Copy link

@tsachiherman it's not that set is reserved by JS (it isn't), it's that set is a method used internally by js-xdr to actually build the structures. Thus, having an actual member named set overwrites that, making it impossible to, well, actually set fields.

so, you're saying that theoretically it would be a parameter provided to the xdrgen to rename a certain names ?

@Shaptic
Copy link
Contributor Author

Shaptic commented Aug 10, 2023

@tsachiherman we can expand the list in member_name as needed of course, now, but I don't think it needs to be configurable if that's what you're implying

I'm just saying that the root cause is more-so that set is "reserved" by js-xdr internally rather than by the language itself.

@Shaptic Shaptic merged commit 8c94e47 into master Aug 11, 2023
3 checks passed
@Shaptic Shaptic deleted the js-avoid-set branch August 11, 2023 17:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

JS: Using set as an arm name for SCSpecTypeDef breaks the js-xdr package.
2 participants