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

JsSymbol #38

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Conversation

chrisbajorin
Copy link

@chrisbajorin chrisbajorin commented Dec 9, 2020

@chrisbajorin chrisbajorin changed the title Symbol primitive JsSymbol Dec 9, 2020
Copy link
Member

@kjvalencik kjvalencik left a comment

Choose a reason for hiding this comment

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

@chrisbajorin This is fantastic! Thanks so much for the contribution.

One recommended addition to this RFC, which is related in usefulness, but not directly tied to it, is adding a Eq implementation for all Value that leverages napi_strict_equals.

text/0000-symbol-primitive.md Outdated Show resolved Hide resolved
text/0000-symbol-primitive.md Outdated Show resolved Hide resolved
text/0000-symbol-primitive.md Show resolved Hide resolved
text/0000-symbol-primitive.md Outdated Show resolved Hide resolved
@chrisbajorin
Copy link
Author

@kjvalencik In regards to Eq, are you just looking for a mention that strict equality should hold for all primitive values, or is this something that fits within the reference-level explanation? I see Eq currently has a blanket implementation on Handle<T>, so I'm not quite sure how this fits in code-wise.

@chrisbajorin
Copy link
Author

Updated to reflect our discussion in neon-bindings/neon#761

@kjvalencik
Copy link
Member

@chrisbajorin This looks really great! I'm going to put it into final comment period! Thanks for your contributions!

@kjvalencik kjvalencik added the final comment period last opportunity to discuss the proposed conclusion label Jul 23, 2021
@dherman
Copy link
Contributor

dherman commented Jul 23, 2021

BTW, I just wanted to note that the description() method can be technically thought of as a convenience method, since you can implement it with other primitives, i.e. the Neon equivalent of:

const getter = Object.getOwnPropertyDescriptor(Symbol.prototype, 'description').get;
getter.call(sym)

Not a crucial point but it makes me feel confident that the description() method is a nice convenience to have and doesn't fundamentally add any complexity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
final comment period last opportunity to discuss the proposed conclusion
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants