Skip to content

fix(Log): restore inherited event properties - #737

Open
dvd233 wants to merge 1 commit into
Tencent:devfrom
dvd233:fix/609-touch-event-properties
Open

fix(Log): restore inherited event properties#737
dvd233 wants to merge 1 commit into
Tencent:devfrom
dvd233:fix/609-touch-event-properties

Conversation

@dvd233

@dvd233 dvd233 commented Aug 30, 2026

Copy link
Copy Markdown

Summary

  • restore inherited enumerable properties when expanding logged DOM events, preserving the behavior introduced for touch相关的事件捕获的对象属性不全 #327
  • keep safe JSON serialization limited to own enumerable properties
  • avoid Svelte 5 reactive deep-reads of host objects with native accessors
  • add a touch-event manual regression case and update both changelogs

Root cause

The Svelte log-tree rewrite replaced the previous for...in traversal with Object.keys(). As a result, TouchEvent expansion only exposed its own isTrusted property and omitted inherited fields such as touches, targetTouches, and changedTouches.

On the current Svelte 5 build, rendering those inherited host objects through legacy reactive blocks can also trigger Illegal invocation while Svelte deep-reads native properties. The tree/value updates now run through beforeUpdate, which preserves updates without recursively inspecting host objects.

Verification

  • focused assertions for own vs. inherited enumerable keys and unchanged safe-JSON behavior
  • npx tsc --build tsconfig.type.json
  • npm run build:wx
  • npm run build
  • npm pack --dry-run --json
  • Pixel 10 Chromium: triggered the Touch Event dev case and expanded type, touches, targetTouches, and changedTouches with no page errors
  • browser regressions for common objects, circular objects, and a throwing inherited getter

Fixes #609

@tencent-adm

tencent-adm commented Aug 30, 2026

Copy link
Copy Markdown
Member

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

vconsole查看打印touch相关的事件捕获的对象属性缺失

2 participants