From d2768cadbf56cdda1f18fe24015786426094252e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ralph=20K=C3=BCpper?= Date: Wed, 2 Sep 2026 07:11:42 +0200 Subject: [PATCH] test(9087): class toString reports source identity after #9465 --- crates/perry/tests/issue_9087_class_ref_add.rs | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/crates/perry/tests/issue_9087_class_ref_add.rs b/crates/perry/tests/issue_9087_class_ref_add.rs index 880e8ec7f5..3e39f263b4 100644 --- a/crates/perry/tests/issue_9087_class_ref_add.rs +++ b/crates/perry/tests/issue_9087_class_ref_add.rs @@ -63,9 +63,17 @@ console.log(valued + 2); assert_eq!( String::from_utf8_lossy(&run.stdout), concat!( - "string function K() { [native code] }1\n", - "string 1function K() { [native code] }\n", - "string function K() { [native code] }01234567\n", + // #9465 made class name/toString/inspect report SOURCE IDENTITY, + // which is what node does — `String(class K {…})` is the class's + // source text, not `function K() { [native code] }`. Verified: + // $ node -e 'class K { static m() { return 1; } }; \ + // console.log("string " + K + "1")' + // string class K { static m() { return 1; } }1 + // Perry reports the TypeScript source it compiled, so the type + // annotation is retained here. + "string class K { static m(): number { return 1; } }1\n", + "string 1class K { static m(): number { return 1; } }\n", + "string class K { static m(): number { return 1; } }01234567\n", "42\n" ) );