From 18e652f12bd7c5f12124f80f964c3d085f525aa4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sa=C3=BAl=20Cabrera?= Date: Thu, 19 Oct 2023 15:05:42 -0400 Subject: [PATCH] Make `JSContextRef::wrap_rust_value` private (#490) While investigating https://github.com/bytecodealliance/javy/issues/486 I realized that this function is still public, which shouldn't be the case as it's only used for wrapping closure types, which is an internal detail about the crate. --- Cargo.lock | 2 +- crates/javy/Cargo.toml | 2 +- crates/quickjs-wasm-rs/CHANGELOG.md | 4 ++++ crates/quickjs-wasm-rs/Cargo.toml | 2 +- crates/quickjs-wasm-rs/src/js_binding/context.rs | 2 +- 5 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index cb1e07a0..996da89b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1956,7 +1956,7 @@ dependencies = [ [[package]] name = "quickjs-wasm-rs" -version = "2.0.2-alpha.1" +version = "3.0.0-alpha.1" dependencies = [ "anyhow", "once_cell", diff --git a/crates/javy/Cargo.toml b/crates/javy/Cargo.toml index 388ab935..73f0eb65 100644 --- a/crates/javy/Cargo.toml +++ b/crates/javy/Cargo.toml @@ -11,7 +11,7 @@ categories = ["wasm"] [dependencies] anyhow = { workspace = true } -quickjs-wasm-rs = { version = "2.0.2-alpha.1", path = "../quickjs-wasm-rs" } +quickjs-wasm-rs = { version = "3.0.0-alpha.1", path = "../quickjs-wasm-rs" } serde_json = { version = "1.0", optional = true } serde-transcode = { version = "1.1", optional = true } rmp-serde = { version = "^1.1", optional = true } diff --git a/crates/quickjs-wasm-rs/CHANGELOG.md b/crates/quickjs-wasm-rs/CHANGELOG.md index b6d0a04d..62733a71 100644 --- a/crates/quickjs-wasm-rs/CHANGELOG.md +++ b/crates/quickjs-wasm-rs/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Unreleased +### Changed +- Make `JSContextRef::wrap_rust_value` private. Similar to + `context::get_rust_value` this function is simply an internal detail. + ## [2.0.1] - 2023-09-11 ### Fixed diff --git a/crates/quickjs-wasm-rs/Cargo.toml b/crates/quickjs-wasm-rs/Cargo.toml index fb607304..223f48d5 100644 --- a/crates/quickjs-wasm-rs/Cargo.toml +++ b/crates/quickjs-wasm-rs/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "quickjs-wasm-rs" -version = "2.0.2-alpha.1" +version = "3.0.0-alpha.1" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/crates/quickjs-wasm-rs/src/js_binding/context.rs b/crates/quickjs-wasm-rs/src/js_binding/context.rs index 48ee7690..2357e0ec 100644 --- a/crates/quickjs-wasm-rs/src/js_binding/context.rs +++ b/crates/quickjs-wasm-rs/src/js_binding/context.rs @@ -315,7 +315,7 @@ impl JSContextRef { } /// Wrap the specified Rust value in a JS value - pub fn wrap_rust_value(&self, value: T) -> Result { + fn wrap_rust_value(&self, value: T) -> Result { // Note the use of `RefCell` to provide checked unique references. Since JS values can be arbitrarily // aliased, we need `RefCell`'s dynamic borrow checking to prevent unsound access. let pointer = Box::into_raw(Box::new(RefCell::new(value)));