From 661b39f72e03deb2ddc801071066a5bbc13c02a1 Mon Sep 17 00:00:00 2001 From: jedel1043 Date: Tue, 31 Jan 2023 20:09:00 -0600 Subject: [PATCH] Reword doc --- boa_engine/src/context/mod.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/boa_engine/src/context/mod.rs b/boa_engine/src/context/mod.rs index 3c03bcf03f2..6fba974b4bc 100644 --- a/boa_engine/src/context/mod.rs +++ b/boa_engine/src/context/mod.rs @@ -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); @@ -259,7 +261,8 @@ impl Context<'_> { /// Since this function receives a `Gc`, 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` returned by the [`Self::compile()`] function. + /// `Gc` 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.