1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2025-01-21 04:52:26 -05:00
This commit is contained in:
Divy Srivastava 2024-12-14 09:59:52 +05:30
parent bf6825e9fa
commit 509bd954da
5 changed files with 23 additions and 13 deletions

25
Cargo.lock generated
View file

@ -668,6 +668,15 @@ version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1bf2a5fb3207c12b5d208ebc145f967fea5cac41a021c37417ccc31ba40f39ee"
[[package]]
name = "capacity_builder"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ab97838e07d98bdddf1e7e191ffe3c718cba7477c0b6607fdfb96ecd696202df"
dependencies = [
"itoa",
]
[[package]]
name = "caseless"
version = "0.2.1"
@ -1482,6 +1491,7 @@ dependencies = [
"bit-set",
"bit-vec",
"bytes",
"capacity_builder",
"cooked-waker",
"deno_core_icudata",
"deno_ops",
@ -1500,7 +1510,6 @@ dependencies = [
"sourcemap 8.0.1",
"static_assertions",
"tokio",
"typeid",
"url",
"v8",
"wasm_dep_analyzer",
@ -1564,9 +1573,9 @@ dependencies = [
[[package]]
name = "deno_doc"
version = "0.161.2"
version = "0.161.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3af787319136f3e7f73ef551c618aeec70794522e36cd75ae35132a3bad983ef"
checksum = "353a39c70d248af04600928cefc8066a9e4535fb6e7d7c518411e5efc822819f"
dependencies = [
"anyhow",
"cfg-if",
@ -4374,9 +4383,9 @@ dependencies = [
[[package]]
name = "itoa"
version = "1.0.11"
version = "1.0.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b"
checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674"
[[package]]
name = "jni-sys"
@ -8073,12 +8082,6 @@ version = "2.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6af6ae20167a9ece4bcb41af5b80f8a1f1df981f6391189ce00fd257af04126a"
[[package]]
name = "typeid"
version = "1.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0e13db2e0ccd5e14a544e8a246ba2312cd25223f616442d7f2cb0e3db614236e"
[[package]]
name = "typenum"
version = "1.17.0"

View file

@ -72,7 +72,7 @@ deno_ast = { workspace = true, features = ["bundler", "cjs", "codegen", "proposa
deno_cache_dir.workspace = true
deno_config.workspace = true
deno_core = { workspace = true, features = ["include_js_files_for_snapshotting"] }
deno_doc = { version = "=0.161.2", features = ["rust", "comrak"] }
deno_doc = { version = "=0.161.3", features = ["rust", "comrak"] }
deno_graph = { version = "=0.86.3" }
deno_lint = { version = "=0.68.2", features = ["docs"] }
deno_lockfile.workspace = true

View file

@ -4498,6 +4498,7 @@ impl<'a> ToV8<'a> for TscRequestArray {
let method_name = deno_core::FastString::from_static(method_name)
.v8_string(scope)
.unwrap()
.into();
let args = args.unwrap_or_else(|| v8::Array::new(scope, 0).into());
let scope_url = serde_v8::to_v8(scope, self.scope)

View file

@ -1424,6 +1424,7 @@ impl<'s> ToV8<'s> for V8MaybeStaticStr {
Cow::Owned(value) => value.into(),
}
.v8_string(scope)
.unwrap()
.into(),
)
}

View file

@ -68,6 +68,7 @@ impl v8::ValueSerializerImpl for SerializerDelegate {
let obj = self.obj(scope);
let key = FastString::from_static("_getSharedArrayBufferId")
.v8_string(scope)
.unwrap()
.into();
if let Some(v) = obj.get(scope, key) {
if let Ok(fun) = v.try_cast::<v8::Function>() {
@ -89,6 +90,7 @@ impl v8::ValueSerializerImpl for SerializerDelegate {
let obj = self.obj(scope);
let key = FastString::from_static("_getDataCloneError")
.v8_string(scope)
.unwrap()
.into();
if let Some(v) = obj.get(scope, key) {
let fun = v
@ -112,6 +114,7 @@ impl v8::ValueSerializerImpl for SerializerDelegate {
let obj = self.obj(scope);
let key = FastString::from_static("_writeHostObject")
.v8_string(scope)
.unwrap()
.into();
if let Some(v) = obj.get(scope, key) {
if let Ok(v) = v.try_cast::<v8::Function>() {
@ -240,6 +243,7 @@ impl v8::ValueDeserializerImpl for DeserializerDelegate {
let obj = v8::Local::new(scope, &self.obj);
let key = FastString::from_static("_readHostObject")
.v8_string(scope)
.unwrap()
.into();
let scope = &mut v8::AllowJavascriptExecutionScope::new(scope);
if let Some(v) = obj.get(scope, key) {
@ -250,7 +254,8 @@ impl v8::ValueDeserializerImpl for DeserializerDelegate {
Err(_) => {
let msg =
FastString::from_static("readHostObject must return an object")
.v8_string(scope);
.v8_string(scope)
.unwrap();
let error = v8::Exception::type_error(scope, msg);
scope.throw_exception(error);
return None;