feat: ToPropertyKey 改走 ToPrimitive,Symbol 键与描述符,转换错误可捕获

This commit is contained in:
2026-08-12 09:59:56 +08:00
parent c287708ddc
commit af61dcf6fc
16 changed files with 265 additions and 86 deletions
+1 -1
View File
@@ -223,7 +223,7 @@ fn regression_bounded_object_numeric_coercion() {
assert_eq!(eval("+({ toString: function() { return '9'; } })"), "9");
assert_eq!(
eval("+({ valueOf: function() { return {}; }, toString: function() { return {}; } })"),
"vm error: TypeError: Cannot convert object to primitive value"
"vm error: uncaught TypeError: Cannot convert object to primitive value"
);
assert_eq!(
eval("+({ valueOf: function() { throw new RangeError('coerce'); } })"),