mirror of
https://github.com/pjh456/OxideJS.git
synced 2026-10-23 18:21:13 +08:00
feat: 统一内部报错模型异常抛出风格
This commit is contained in:
@@ -47,6 +47,11 @@ pub fn create_type_error(vm: &mut Vm, msg: &str) -> JsValue {
|
||||
create_error_object(vm, proto_ptr, "TypeError", msg)
|
||||
}
|
||||
|
||||
pub fn create_error(vm: &mut Vm, msg: &str) -> JsValue {
|
||||
let proto_ptr = P::as_ptr(&vm.kernel().builtin_world().error_proto) as *mut JsObject;
|
||||
create_error_object(vm, proto_ptr, "Error", msg)
|
||||
}
|
||||
|
||||
pub fn create_reference_error(vm: &mut Vm, msg: &str) -> JsValue {
|
||||
let proto_ptr = P::as_ptr(&vm.kernel().builtin_world().reference_error_proto) as *mut JsObject;
|
||||
create_error_object(vm, proto_ptr, "ReferenceError", msg)
|
||||
|
||||
Reference in New Issue
Block a user