test: pin the type tag on the bun wrapper that collects extra

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01H9xMqWcQBvJwrvMb5Tw3nH
This commit is contained in:
Ruben Fiszel
2026-09-01 10:48:42 +00:00
co-authored by Claude Opus 5
parent d995522ddd
commit a1d7c530bd
+7 -1
View File
@@ -458,7 +458,8 @@ export function main() {
);
}
// An acyclic thrown object still reports its own properties, unchanged.
// An acyclic thrown object still reports its own properties, unchanged. Carrying
// `extra` does not stand in for identifying the throw, so the type tag reports it too.
{
let job = bun_job(r#"export function main() { throw { code: 42, hint: "kein Error" }; }"#);
let completed = run_job_in_new_worker_until_complete(&db, false, job, port).await;
@@ -468,6 +469,11 @@ export function main() {
result["error"]["extra"],
serde_json::json!({ "code": 42, "hint": "kein Error" })
);
assert_eq!(
result["error"]["message"],
serde_json::json!("[object Object]")
);
assert_eq!(result["error"]["name"], serde_json::json!("ThrownValue"));
}
Ok(())