mirror of
https://github.com/pjh456/OxideJS.git
synced 2026-10-25 19:21:11 +08:00
feat: 符号键编码加 realm 维度并把符号表移入 realm
This commit is contained in:
@@ -986,7 +986,7 @@ fn string_to_bigint_full<H: VmHost>(host: &mut H, s: &str) -> Result<JsValue, St
|
||||
pub fn to_string_for_string_constructor<H: VmHost>(val: JsValue, host: &mut H) -> Result<String, String> {
|
||||
// 原始 Symbol:步骤 2a,SymbolDescriptiveString(不经 ToString)。
|
||||
if val.is_symbol() {
|
||||
let desc = host.symbol_description(val.as_symbol_index()).unwrap_or("");
|
||||
let desc = host.symbol_description(val.as_symbol_index()).unwrap_or_default();
|
||||
return Ok(format!("Symbol({desc})"));
|
||||
}
|
||||
// 步骤 3:ToString。装箱 Symbol 经 ToPrimitive 得 Symbol 本体,ToString 抛 TypeError。
|
||||
|
||||
Reference in New Issue
Block a user