boa-dev / boa

Boa is an embeddable and experimental Javascript engine written in Rust. Currently, it has support for some of the language.
MIT License
4.99k stars 395 forks source link

Tracking issue for `JsObject` safe wrappers #2098

Open jedel1043 opened 2 years ago

jedel1043 commented 2 years ago

This is the main tracking issue listing all the JsObjects for which we could implement safe wrappers, and the implementation progress for them.

Feel free to leave a comment if there's something missing.

nekevss commented 2 years ago

Hi! Would it be fine to take a crack at one or two of these or is someone currently working on them?

Razican commented 2 years ago

Hi! Would it be fine to take a crack at one or two of these or is someone currently working on them?

Go ahead! Let us know in which ones you'll start working on :)

nekevss commented 2 years ago

@Razican I'll start working on JsMap if no one else has started on it

jedel1043 commented 2 years ago

@Razican I'll start working on JsMap if no one else has started on it

Nice! I'll edit the description to assign you that work :)

lameferret commented 2 years ago

@jedel1043 can I give JsSet a shot?

jedel1043 commented 2 years ago

@anuvratsingh Please do! If you need some guidance, you can post a comment here or in our discord :)

nekevss commented 2 years ago

@jedel1043 Would it be fine to work on JsArrayBuffer and JsDataView?

jedel1043 commented 2 years ago

@nekevss That would be very nice :D

HalidOdat commented 2 years ago

Ummm... I didn't see this conversation before I implemented JsArrayBuffer (#2170 ) 😅 . I needed it to be implemented so I could fully fix (in a clean way) the Vec<u8> to JsTypedArray as discussed in #2058.

Though you can work on JsDataView if you still want it

lameferret commented 2 years ago

Can I do JsDate, and why builtins::Math doesn't require a wrapper?

HalidOdat commented 2 years ago

Can I do JsDate

Sure! :)

why builtins::Math doesn't require a wrapper?

The reasons is because it not a constructor and the static methods it provides do not offer anything that rust can't do (in fact they are wrappers around rust functions like f64.sqrt(), f64.pow(), etc)

nekevss commented 2 years ago

Ummm... I didn't see this conversation before I implemented JsArrayBuffer (#2170 ) 😅

All good :) I can focus on working on JsDataView. I might look at adding some additional methods to JsArrayBuffer that were mentioned in #2058 like take and clone/borrow. Unless you don't think those are needed then I can leave it as is.

HalidOdat commented 2 years ago

I might look at adding some additional methods to JsArrayBuffer that were mentioned in #2170 like take and clone/borrow. Unless you don't think those are needed then I can leave it as is.

As far as I know ArrayBuffer does not have such methods. The only method that is missing is ArrayBuffer.prototype.slice you can see JsArray::slice() implementation since they are very simular

nekevss commented 2 years ago

Oh sorry! I linked the wrong thread. I updated the link in the above comment. The discussion had to do with providing methods to interact with array_buffer_data.

nekevss commented 1 year ago

@jedel1043 If nobody else is working it yet, I'll work on JsRegExp. Also, as a side note, I think these objects being moved into their own module is in a different commit, but is it going to be easier to separate these files into their own folder like external_objects or js_objects in object?

nekevss commented 1 year ago

Awkward, accidentally opened up an issue 😂 Just wanted to note that JsGenerator was added with #2380.