neon-bindings / rfcs

RFCs for changes to Neon
Apache License 2.0
14 stars 9 forks source link

JsSymbol #38

Open chrisbajorin opened 3 years ago

chrisbajorin commented 3 years ago

Rendered: https://github.com/chrisbajorin/rfcs/blob/symbol-primitive/text/0000-symbol-primitive.md

chrisbajorin commented 3 years ago

@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 commented 3 years ago

Updated to reflect our discussion in https://github.com/neon-bindings/neon/pull/761

kjvalencik commented 3 years ago

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

dherman commented 3 years ago

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.