diff --git a/boa_engine/src/builtins/function/mod.rs b/boa_engine/src/builtins/function/mod.rs index 72378204ba4..de952d859fe 100644 --- a/boa_engine/src/builtins/function/mod.rs +++ b/boa_engine/src/builtins/function/mod.rs @@ -267,7 +267,16 @@ unsafe impl Trace for FunctionKind { custom_trace! {this, { match this { Self::Native { function, .. } => {mark(function)} - Self::Ordinary { code, environments, home_object, fields, private_methods, class_object, .. } => { + Self::Ordinary { + code, + environments, + home_object, + fields, + private_methods, + class_object, + script_or_module, + .. + } => { mark(code); mark(environments); mark(home_object); @@ -278,6 +287,7 @@ unsafe impl Trace for FunctionKind { mark(elem); } mark(class_object); + mark(script_or_module); } Self::Async { code, environments, home_object, class_object, script_or_module } | Self::Generator { code, environments, home_object, class_object, script_or_module} diff --git a/boa_engine/src/job.rs b/boa_engine/src/job.rs index 707fd2f334d..7e9a2a1bf64 100644 --- a/boa_engine/src/job.rs +++ b/boa_engine/src/job.rs @@ -201,7 +201,7 @@ pub trait JobQueue { /// such that execution is prepared to evaluate ECMAScript code at the time of job's invocation. /// > - Let `scriptOrModule` be `GetActiveScriptOrModule()` at the time `HostEnqueuePromiseJob` is invoked. If realm /// is not null, each time job is invoked the implementation must perform implementation-defined steps such that - /// scriptOrModule is the active script or module at the time of job's invocation. + /// `scriptOrModule` is the active script or module at the time of job's invocation. /// > - Jobs must run in the same order as the `HostEnqueuePromiseJob` invocations that scheduled them. /// /// Of all the requirements, Boa guarantees the first two by its internal implementation of `NativeJob`, meaning diff --git a/boa_engine/src/script.rs b/boa_engine/src/script.rs index ee5edac418f..3e4c06b96c3 100644 --- a/boa_engine/src/script.rs +++ b/boa_engine/src/script.rs @@ -129,6 +129,8 @@ impl Script { /// /// 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. + /// + /// [`JobQueue::run_jobs`]: crate::job::JobQueue::run_jobs pub fn evaluate(&self, context: &mut Context<'_>) -> JsResult { let _timer = Profiler::global().start_event("Execution", "Main");