script: Implement creating and running classic scripts according to spec (#41109)

Implemented spec algorithms [create a classic
script](https://html.spec.whatwg.org/multipage/#creating-a-classic-script)
and [run a classic
script](https://html.spec.whatwg.org/multipage/#run-a-classic-script).
Classic script now gets unminified on creation.

Testing: Behaviour hasn't changed much, but we pass a new test instead
of crashing.

---------

Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>
This commit is contained in:
Gae24
2025-12-07 20:06:41 +01:00
committed by GitHub
parent 371e7fc9f6
commit 3b205ad8f2
6 changed files with 298 additions and 159 deletions

View File

@@ -104,7 +104,11 @@ impl ModuleObject {
pub(crate) struct RethrowError(RootedTraceableBox<Heap<JSVal>>);
impl RethrowError {
fn handle(&self) -> Handle<'_, JSVal> {
pub(crate) fn new(val: Box<Heap<JSVal>>) -> Self {
Self(RootedTraceableBox::from_box(val))
}
pub(crate) fn handle(&self) -> Handle<'_, JSVal> {
self.0.handle()
}
}