Skip to content

Commit deabc97

Browse files
chore(deps): Bump rquickjs from 0.11.0 to 0.12.0 in /src/code-validator/guest (#173)
* chore(deps): Bump rquickjs in /src/code-validator/guest Bumps [rquickjs](https://github.com/DelSkayn/rquickjs) from 0.11.0 to 0.12.0. - [Changelog](https://github.com/DelSkayn/rquickjs/blob/master/CHANGELOG.md) - [Commits](DelSkayn/rquickjs@v0.11.0...v0.12.0) --- updated-dependencies: - dependency-name: rquickjs dependency-version: 0.12.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * fix(guest): adapt Resolver/Loader to rquickjs 0.12 rquickjs 0.12 adds an import-attributes parameter to the module loader traits: `Resolver::resolve` and `Loader::load` now take a trailing `Option<ImportAttributes>` (for `import ... with { type }`). Update StubModuleLoader's impls to match the new signatures; the stub ignores attributes since it accepts any module for syntax validation. Signed-off-by: Simon Davies <simongdavies@users.noreply.github.com> --------- Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: Simon Davies <simongdavies@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Simon Davies <simongdavies@users.noreply.github.com>
1 parent 38b50c9 commit deabc97

3 files changed

Lines changed: 27 additions & 21 deletions

File tree

src/code-validator/guest/Cargo.lock

Lines changed: 12 additions & 17 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/code-validator/guest/runtime/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ serde_json = { version = "1", default-features = false, features = ["alloc"] }
2525
regex-automata = { version = "0.4", default-features = false, features = ["alloc", "meta", "nfa-pikevm"] }
2626
nom = { version = "8.0", default-features = false, features = ["alloc"] }
2727
spin = "0.10"
28-
rquickjs = { version = "0.11", default-features = false, features = ["bindgen", "loader"] }
28+
rquickjs = { version = "0.12", default-features = false, features = ["bindgen", "loader"] }
2929
hashbrown = "0.17"
3030
sha2 = { version = "0.11", default-features = false }
3131

src/code-validator/guest/runtime/src/validator.rs

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ use alloc::vec::Vec;
3232
use core::cell::RefCell;
3333
use core::sync::atomic::{AtomicU64, Ordering};
3434
use hashbrown::HashMap;
35-
use rquickjs::loader::{Loader, Resolver};
35+
use rquickjs::loader::{ImportAttributes, Loader, Resolver};
3636
use rquickjs::{Context, Ctx, Module, Result as QjsResult, Runtime};
3737
use serde::{Deserialize, Serialize};
3838
use sha2::{Digest, Sha256};
@@ -62,14 +62,25 @@ struct StubModuleLoader {
6262
}
6363

6464
impl Resolver for StubModuleLoader {
65-
fn resolve(&mut self, _ctx: &Ctx<'_>, _base: &str, name: &str) -> QjsResult<String> {
65+
fn resolve(
66+
&mut self,
67+
_ctx: &Ctx<'_>,
68+
_base: &str,
69+
name: &str,
70+
_attributes: Option<ImportAttributes<'_>>,
71+
) -> QjsResult<String> {
6672
// Accept any module name for syntax validation
6773
Ok(name.to_string())
6874
}
6975
}
7076

7177
impl Loader for StubModuleLoader {
72-
fn load<'js>(&mut self, ctx: &Ctx<'js>, name: &str) -> QjsResult<Module<'js>> {
78+
fn load<'js>(
79+
&mut self,
80+
ctx: &Ctx<'js>,
81+
name: &str,
82+
_attributes: Option<ImportAttributes<'js>>,
83+
) -> QjsResult<Module<'js>> {
7384
// Track that we saw this module
7485
self.seen.borrow_mut().insert(name.to_string(), ());
7586
// Provide a minimal stub module

0 commit comments

Comments
 (0)