-
-
Notifications
You must be signed in to change notification settings - Fork 402
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
Implement Set() #400
Comments
Hey all, I'm interested in picking this up. |
Assigned |
Have a WIP local implementation, but relies on |
I was curious, how you implemented it! because |
Oops, sorry, I meant to say that I implemented it using What I did with that was create a wrapper struct for After that it was just a matter of translating some of the spec operations to my implementation, such as the validity check being that the internal_state field could be downcasted to what I expected, then doing Vec operations on it.
Good luck! What kind of approach are you doing? I am curious about this. |
Well I checked the standard and for For |
unassigned @brian-gavin due to inactivity, feel free to mention here if you still wanted this. |
I can take this issue |
I'd sugest waiting for #722 since it changes a bit how builtins are implemented, maybe you could start your |
Hi @winnayx, do you have any update on this? |
I've implemented about half of Line 942 in 04da7ff
My first idea was to make it usable for both cases, sadly this will add more boiler plate at the call-site for pub fn property<K, P>(&mut self, key: K, property: P) -> &mut Self
where
K: Into<PropertyKey>,
P: Into<PropertyDescriptor>,
{
self.prototype.borrow_mut().insert(key, property.into());
self
} It doesn't feel as punishing for @HalidOdat you implemented the |
This approach is much better. I don't think changing If we want to add a property descriptor we should have a method that does that with a clear name, instead of pub fn property_descriptor<K, P>(&mut self, key: K, property: P) -> &mut Self
where
K: Into<PropertyKey>,
P: Into<PropertyDescriptor>,
{
self.prototype.borrow_mut().insert(key, property.into());
self
} We should also add a method |
Yes, any change would also include updates to the
(I prefer to use more complete names to make them easier to understand) I'm not sure we would have use for the last 2 immediately but it seems like a nice API to provide. |
6 = 3 * 2 2 instance and static properties 3 data, accessor and properties discussed in #400
6 = 3 * 2 2 instance and static properties 3 data, accessor and properties discussed in #400
ECMASCript feature
Set objects are collections of ECMAScript language values. A distinct value may only occur once as an element of a Set's collection. Distinct values are discriminated using the SameValueZero comparison algorithm.
I would like to see
Set
implemented. ECMAScript specification.Example code
Example to work from
Array is implemented here: https://github.com/jasonwilliams/boa/blob/master/boa/src/builtins/array/mod.rs
Contributing
https://github.com/jasonwilliams/boa/blob/master/CONTRIBUTING.md
The text was updated successfully, but these errors were encountered: