fix: 修复测试的 clippy lint 警告

This commit is contained in:
2026-06-05 21:31:11 +08:00
parent 4c94d7c40e
commit c7b8b22cf7
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -162,7 +162,7 @@ impl JsObject {
let self_ptr = self as *const JsObject; let self_ptr = self as *const JsObject;
while cursor.is_object() { while cursor.is_object() {
let cursor_ptr = cursor.as_js_object_ptr(); let cursor_ptr = cursor.as_js_object_ptr();
if cursor_ptr == self_ptr as *mut JsObject { if std::ptr::eq(cursor_ptr, self_ptr) {
return Err("cyclic __proto__ value"); return Err("cyclic __proto__ value");
} }
let obj = unsafe { &*cursor_ptr }; let obj = unsafe { &*cursor_ptr };
+2 -2
View File
@@ -356,7 +356,7 @@ impl Vm {
let new_shape_id = shape::make_shape(obj.shape_id(), prop_name_si); let new_shape_id = shape::make_shape(obj.shape_id(), prop_name_si);
obj.set_shape_id(new_shape_id); obj.set_shape_id(new_shape_id);
obj.set_prop_count(new_offset + 1); obj.set_prop_count(new_offset + 1);
obj.set_prop_expand(new_offset, self.regs[a], &self.epoch.bump()); obj.set_prop_expand(new_offset, self.regs[a], self.epoch.bump());
obj.bump_generation(); obj.bump_generation();
} }
} }
@@ -395,7 +395,7 @@ impl Vm {
let new_shape_id = shape::make_shape(obj.shape_id(), prop_name_si); let new_shape_id = shape::make_shape(obj.shape_id(), prop_name_si);
obj.set_shape_id(new_shape_id); obj.set_shape_id(new_shape_id);
obj.set_prop_count(new_offset + 1); obj.set_prop_count(new_offset + 1);
obj.set_prop_expand(new_offset, self.regs[b], &self.epoch.bump()); obj.set_prop_expand(new_offset, self.regs[b], self.epoch.bump());
obj.bump_generation(); obj.bump_generation();
} }
} }