mirror of
https://github.com/pjh456/OxideJS.git
synced 2026-10-24 02:31:13 +08:00
feat: 补全 Error 栈访问器 isError toJSON 与 Promise.try
This commit is contained in:
@@ -158,6 +158,7 @@ impl BuiltinWorld {
|
||||
("URIError", methods.uri_error, 1),
|
||||
("EvalError", methods.eval_error, 1),
|
||||
("SuppressedError", methods.suppressed_error, 3),
|
||||
("isError", methods.is_error, 1),
|
||||
);
|
||||
|
||||
let proto_ptr = P::as_ptr(&self.error_proto) as *mut JsObject;
|
||||
@@ -168,7 +169,7 @@ impl BuiltinWorld {
|
||||
string_forge,
|
||||
shape_forge,
|
||||
("toString", methods.to_string, 0),
|
||||
("stack", methods.stack, 0),
|
||||
("toJSON", methods.to_json, 1),
|
||||
);
|
||||
|
||||
let si_name = string_forge.intern("name").0;
|
||||
|
||||
@@ -83,7 +83,8 @@ pub struct ErrorMethods {
|
||||
pub eval_error: *const (),
|
||||
pub suppressed_error: *const (),
|
||||
pub to_string: *const (),
|
||||
pub stack: *const (),
|
||||
pub is_error: *const (),
|
||||
pub to_json: *const (),
|
||||
}
|
||||
|
||||
/// String 静态方法与原型方法的 native 函数指针集合,由 [crate::builtin::BuiltinWorld::bind_string_methods] 安装。
|
||||
|
||||
Reference in New Issue
Block a user