boa icon indicating copy to clipboard operation
boa copied to clipboard

Tracking issue for `JsObject` safe wrappers

Open jedel1043 opened this issue 3 years ago • 16 comments

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

  • [x] JsArray (#1746)
  • [x] JsFunction (#2015)
  • [x] JsProxy (#2076)
  • [x] JsTypedArray (#2003)
  • [x] JsArrayBuffer (#2170)
  • [x] JsDataView (#2308)
  • [x] JsMap (#2115)
  • [x] JsSet (#2162)
  • [x] JsDate (#2181)
  • [x] JsRegExp (#2326)
  • [x] JsGenerator (#2380)
  • [ ] JsGeneratorFunction
  • [ ] JsWeakMap
  • [ ] JsWeakSet
  • [x] JsPromise (#2687)
  • [ ] JsAsyncGenerator

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

jedel1043 avatar Jun 01 '22 22:06 jedel1043

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

nekevss avatar Jun 05 '22 17:06 nekevss

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 :)

Razican avatar Jun 05 '22 17:06 Razican

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

nekevss avatar Jun 09 '22 23:06 nekevss

@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 :)

jedel1043 avatar Jun 09 '22 23:06 jedel1043

@jedel1043 can I give JsSet a shot?

lameferret avatar Jul 03 '22 16:07 lameferret

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

jedel1043 avatar Jul 03 '22 16:07 jedel1043

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

nekevss avatar Jul 07 '22 00:07 nekevss

@nekevss That would be very nice :D

jedel1043 avatar Jul 07 '22 01:07 jedel1043

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

HalidOdat avatar Jul 07 '22 05:07 HalidOdat

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

lameferret avatar Jul 07 '22 13:07 lameferret

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)

HalidOdat avatar Jul 07 '22 14:07 HalidOdat

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.

nekevss avatar Jul 07 '22 23:07 nekevss

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

HalidOdat avatar Jul 08 '22 06:07 HalidOdat

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 avatar Jul 08 '22 12:07 nekevss

@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 avatar Oct 04 '22 02:10 nekevss

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

nekevss avatar Dec 13 '22 23:12 nekevss