boa icon indicating copy to clipboard operation
boa copied to clipboard

Improve `ConstructorBuilder` and `ObjectInitializer`

Open wusyong opened this issue 3 years ago • 0 comments

I tried a V8 attempt on DOM crate this weekend. While it still has lots of different interfaces to work with. I found both engines still share some logic in defining custom types:

ECMASCript feature Sorry, I'm not sure if this is the correct comparison, but FunctionTemplate provides many flexibilities. It can get instance and prototype templates. It can not only get the JS function but also create the instance. While I don't believe we should totally follow its "template" design, I feel like maybe boa can provide methods and trait impls similar to this.

Example code I don't have exact example code, but ideally I think we should provide document example like V8's FunctionTemplate document.

wusyong avatar Jun 26 '22 19:06 wusyong