Skip to content
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

Add usage example for JsPromise wrapper #2761

Open
jedel1043 opened this issue Mar 29, 2023 · 5 comments · May be fixed by #2804
Open

Add usage example for JsPromise wrapper #2761

jedel1043 opened this issue Mar 29, 2023 · 5 comments · May be fixed by #2804
Labels
builtins PRs and Issues related to builtins/intrinsics E-Easy Easy enhancement New feature or request good first issue Good for newcomers

Comments

@jedel1043
Copy link
Member

Seeing that almost all wrappers have its own entry in boa_examples, it would be good to have one for the recently introduced JsPromise wrapper:

#[derive(Debug, Clone, Trace, Finalize)]
pub struct JsPromise {
inner: JsObject,
}

@jedel1043 jedel1043 added enhancement New feature or request good first issue Good for newcomers E-Easy Easy builtins PRs and Issues related to builtins/intrinsics labels Mar 29, 2023
@jedel1043
Copy link
Member Author

Leaving this issue for newcomers. Feel free to ask for an assignment if you're interested in contributing! :D

@lvllvl
Copy link

lvllvl commented Apr 10, 2023

I'd like to try my hand at this issue, if that's ok.

@jedel1043
Copy link
Member Author

jedel1043 commented Apr 10, 2023

@lvllvl Let me assign it to you :)

@lvllvl
Copy link

lvllvl commented Apr 10, 2023

So if I understand correctly, this would be similar to what was done between:

  • boa_engine/src/object/builtins/jsregexp.rs and boa_examples/src/bin/jsregexp.rs

Where:

  • The example in boa_engine/src/object/builtins/jsregexp.rs on line 18 appears in boa_examples/src/bin/jsregexp.rs.

So you'd like something similar for jspromise. Specifically:

  • Take the example in boa_engine/src/object/builtins/jspromise.rs (line 115-155)
  • Create a file boa_examples/src/bin/jspromise.rs and use the example from boa_engine/src/object/builtins/jspromise.rs (line 115-155)

Is that correct?

@jedel1043
Copy link
Member Author

jedel1043 commented Apr 11, 2023

Yep, essentially to "extend" the doc example of JsPromise with a somewhat realistic usage of the API, possibly using the majority of the utility functions.

@lvllvl lvllvl linked a pull request Apr 11, 2023 that will close this issue
@lvllvl lvllvl removed their assignment Jul 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
builtins PRs and Issues related to builtins/intrinsics E-Easy Easy enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants