feat: 符号键编码加 realm 维度并把符号表移入 realm

This commit is contained in:
2026-10-07 02:13:07 +00:00
parent 55bec82f69
commit 28d21e7929
15 changed files with 202 additions and 52 deletions
+1 -1
View File
@@ -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。