From ee20a711ded7a8a9dfab2f3cfbed053e30329848 Mon Sep 17 00:00:00 2001 From: pjh456 <147148383@qq.com> Date: Sun, 11 Oct 2026 10:47:05 +0000 Subject: [PATCH] =?UTF-8?q?style:=20=E8=87=AA=E5=8A=A8=E6=A0=BC=E5=BC=8F?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crates/oxide_vm/src/bindings/bind_worker.rs | 6 +----- crates/oxide_vm/src/worker/mod.rs | 6 ++---- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/crates/oxide_vm/src/bindings/bind_worker.rs b/crates/oxide_vm/src/bindings/bind_worker.rs index 6a2a34f5..566a24fb 100644 --- a/crates/oxide_vm/src/bindings/bind_worker.rs +++ b/crates/oxide_vm/src/bindings/bind_worker.rs @@ -175,11 +175,7 @@ pub fn bind_worker(core: &Arc, session: &KernelSession, global: &mut world, global, core, - &[( - "importScripts", - crate::worker::bindings::import_scripts as *const (), - 1, - )], + &[("importScripts", crate::worker::bindings::import_scripts as *const (), 1)], ); } // EventTarget 三方法直绑全局(worker realm 经 self === global 可达;全局原型链 diff --git a/crates/oxide_vm/src/worker/mod.rs b/crates/oxide_vm/src/worker/mod.rs index 21279616..2b778d34 100644 --- a/crates/oxide_vm/src/worker/mod.rs +++ b/crates/oxide_vm/src/worker/mod.rs @@ -977,8 +977,7 @@ mod tests { let got = global_value_opt(&vm, "got").expect("got 应被设置"); let got_text = vm.lookup_str(got).expect("got 应可读"); assert_eq!( - got_text, - "7|function|true", + got_text, "7|function|true", "lib.js 应同步执行、importScripts 应为 function 且经 self 可达" ); @@ -1072,8 +1071,7 @@ mod tests { let got = global_value_opt(&vm, "got").expect("got 应被设置"); let got_text = vm.lookup_str(got).expect("got 应可读"); assert_eq!( - got_text, - "TypeError|SyntaxError|boom", + got_text, "TypeError|SyntaxError|boom", "文件不存在应抛 TypeError、语法错误应抛 SyntaxError、运行期异常应原值透传" );