Files
ttstd-infinite-canvas/web
AetherNo2332 edcf7bc7c0 fix(web): 诊断 - 在没有 window.location 的环境不再抛错 (#559)
Original-Commit: cdb07ca9cbdd74e63d8e80659f3bdbd6d49b3dff
fix(web): 诊断 - 在没有 window.location 的环境不再抛错

recordDiagnosticEvent / normalizeRoute 用 `typeof window !== "undefined"` 判断"在浏览器里",
但 bun 的测试环境里 window 存在、window.location 不存在,于是每次记录诊断事件都抛
`TypeError: undefined is not an object (evaluating 'window.location.pathname')`,
director-diagnostics-recorder 的 9 条基线用例因此全红。

改成 browserLocation():window 与 window.location 都探测,取不到就当没有地址(路由回落 "/")。
浏览器内的行为完全不变。
2026-09-21 09:37:19 +08:00
..
2026-09-14 01:11:56 +08:00