feat: 支持 RegExpr 与 Symbol 部分方法

This commit is contained in:
2026-06-08 10:36:39 +08:00
parent 125b91ddae
commit b8fbc93bca
19 changed files with 1057 additions and 45 deletions
+9
View File
@@ -101,6 +101,9 @@ pub fn to_boolean(val: JsValue, string_forge: &StringForge) -> bool {
if val.is_object() {
return true;
}
if val.is_symbol() {
return true;
}
false
}
@@ -172,6 +175,9 @@ pub fn strict_eq(lhs: JsValue, rhs: JsValue) -> bool {
if lhs.is_object() && rhs.is_object() {
return lhs.as_ptr() == rhs.as_ptr();
}
if lhs.is_symbol() && rhs.is_symbol() {
return lhs.as_symbol_index() == rhs.as_symbol_index();
}
false
}
@@ -260,6 +266,9 @@ pub fn same_value(lhs: JsValue, rhs: JsValue) -> bool {
if lhs.is_object() && rhs.is_object() {
return lhs.as_ptr() == rhs.as_ptr();
}
if lhs.is_symbol() && rhs.is_symbol() {
return lhs.as_symbol_index() == rhs.as_symbol_index();
}
false
}