Skip to content

Commit

Permalink
Reword doc
Browse files Browse the repository at this point in the history
  • Loading branch information
jedel1043 committed Feb 1, 2023
1 parent f0979cf commit 661b39f
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions boa_engine/src/context/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -189,10 +189,12 @@ impl Context<'_> {
///
/// # Examples
/// ```
/// # use boa_engine::Context;
/// # use boa_engine::{Context, Source};
/// let mut context = Context::default();
///
/// let value = context.eval_module("1 + 3").unwrap();
/// let source = Source::from_bytes("1 + 3");
///
/// let value = context.eval_module(source).unwrap();
///
/// assert!(value.is_number());
/// assert_eq!(value.as_number().unwrap(), 4.0);
Expand Down Expand Up @@ -259,7 +261,8 @@ impl Context<'_> {
/// Since this function receives a `Gc<CodeBlock>`, cloning the code is very cheap, since it's
/// just a pointer copy. Therefore, if you'd like to execute the same `CodeBlock` multiple
/// times, there is no need to re-compile it, and you can just call `clone()` on the
/// `Gc<CodeBlock>` returned by the [`Self::compile()`] function.
/// `Gc<CodeBlock>` returned by the [`Context::compile_script`] or [`Context::compile_module`]
/// functions.
///
/// Note that this won't run any scheduled promise jobs; you need to call [`Context::run_jobs`]
/// on the context or [`JobQueue::run_jobs`] on the provided queue to run them.
Expand Down

0 comments on commit 661b39f

Please sign in to comment.