-
-
Notifications
You must be signed in to change notification settings - Fork 401
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 #2804
base: main
Are you sure you want to change the base?
Conversation
builtins::promise::PromiseState, | ||
Context, JsValue, js_string}; | ||
|
||
fn main() -> Result<(), Box<dyn Error>> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The example looks good, but looking at other examples, we should be adding more comments through the code, explaining what each step does.
Also, is there any other API usage we can show?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added comments to the code.
Do you mean that this example should use more of the api or that there should be another jspromise example in addition to this one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably that the example should use more methods of JsPromise
.
Codecov Report
@@ Coverage Diff @@
## main #2804 +/- ##
==========================================
- Coverage 51.30% 51.28% -0.02%
==========================================
Files 416 417 +1
Lines 41193 41204 +11
==========================================
Hits 21133 21133
- Misses 20060 20071 +11
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
@lvllvl Do you have any progress for this? If you don't have the time to work on this, that's also okay :) |
This Pull Request fixes/closes #2761 .
It adds the following:
boa_examples/src/bin/jspromise.rs
boa_engine/src/object/builtins/jspromise.rs
(line 115-155)