mirror of
https://github.com/pjh456/OxideJS.git
synced 2026-10-25 03:01:12 +08:00
fix: fmt 收口与 clippy ptr_eq 收敛,padStart 测试期望对齐码元口径
This commit is contained in:
@@ -44,7 +44,11 @@ impl Vm {
|
||||
// 函数形态按生成器 / 异步标志分流,编译标志(is_generator / is_async)
|
||||
// 由 emit 层从 AST 读回,函数对象原型与 prototype 属性面随之自动分流。
|
||||
let prefix = if is_async {
|
||||
if is_generator { "async function*" } else { "async function" }
|
||||
if is_generator {
|
||||
"async function*"
|
||||
} else {
|
||||
"async function"
|
||||
}
|
||||
} else if is_generator {
|
||||
"function*"
|
||||
} else {
|
||||
|
||||
@@ -189,10 +189,10 @@ impl oxide_runtime_api::VmHost for Vm {
|
||||
if !proto.is_object() {
|
||||
return false;
|
||||
}
|
||||
let p = proto.as_js_object_ptr();
|
||||
p == self.generator_function_proto.as_ptr() as *mut JsObject
|
||||
|| p == self.async_function_proto.as_ptr() as *mut JsObject
|
||||
|| p == self.async_generator_function_proto.as_ptr() as *mut JsObject
|
||||
let p = proto.as_js_object_ptr() as *const JsObject;
|
||||
std::ptr::eq(p, self.generator_function_proto.as_ptr())
|
||||
|| std::ptr::eq(p, self.async_function_proto.as_ptr())
|
||||
|| std::ptr::eq(p, self.async_generator_function_proto.as_ptr())
|
||||
}
|
||||
fn promote_if_needed_for_write_ptr(&mut self, target_ptr: *mut JsObject, value: JsValue) -> JsValue {
|
||||
self.promote_if_needed_for_write_ptr(target_ptr, value)
|
||||
|
||||
Reference in New Issue
Block a user