mirror of
https://github.com/pjh456/OxideJS.git
synced 2026-10-25 03:01:12 +08:00
refactor: 统一错误对象构造与异常类型传播
This commit is contained in:
@@ -66,11 +66,11 @@ impl Vm {
|
||||
&mut self, getter: JsValue, receiver: JsValue, target_reg: u8,
|
||||
) -> Result<bool, String> {
|
||||
if !getter.is_object() {
|
||||
return Err("TypeError: getter is not callable".into());
|
||||
return Err(self.error_message_text("TypeError", "getter is not callable"));
|
||||
}
|
||||
let getter_obj = unsafe { &*getter.as_js_object_ptr() };
|
||||
if !getter_obj.is_function() {
|
||||
return Err("TypeError: getter is not callable".into());
|
||||
return Err(self.error_message_text("TypeError", "getter is not callable"));
|
||||
}
|
||||
|
||||
if getter_obj.native_fn().is_some() {
|
||||
|
||||
Reference in New Issue
Block a user