Backtestsvuerun-20261021-133314#12124
defineCustomElement can accidentally override members of the Element prototype
Our patch was judged better than the merged fix.
In this judgment, Patch A = our agent, Patch B = the merged fix.
Both patches satisfy the independent tests, and both add a dev warning when a declared prop collides with an inherited Element member. The difference is what happens after the warning. Patch B still defines the prop on the element and overwrites `tagName` (its own test asserts `e.tagName` becomes 'foo'), so in production builds nothing changes at all and the breakage the issue describes (a `tag-name` attribute clobbering `Element.prototype.tagName`) persists. Patch A addresses the root cause: it walks the prototype chain, refuses to shadow read-only accessors/non-writable values/methods, keeps the attribute-to-prop path working, and adds a `patchProp` branch so a Vue parent can still pass such props (via `_setProp`) without touching the native member. It also hardens the `expose` path with the same check while still permitting intentional method overrides. Its tests are substantive: they assert native `tagName`/`remove` survive, `hasOwnProperty` is false, attribute and parent-driven updates still flow to the prop, and writable reflected members like `title` keep the old mapping. Patch A is larger and has minor craft issues (a `@ts-expect-error` to reach a private field, a `_isVueCE`/`_isProtectedProp` coupling from `patchProp`), and Patch B's one-line `key in proto` check is admittedly simpler and lower risk. But B's test that overrides `hasAttribute` with an object illustrates the hazard of leaving the overwrite in place rather than resolving it. Patch B also includes an unrelated assertion tweak at line 237. Weighing correctness first, A resolves the issue while B only reports it, so A wins.
Four judges ruled on this ticket in parallel, and the verdict comes from counting their votes. Each saw the issue and the two patches, labelled A and B in random order (two of them saw ours as A), with issue links and version numbers removed. Where tests could check the fix, they also saw the results of tests a separate agent wrote for the issue, run on both patches. None was told which patch was ours. The reasoning above is one judge's, shown verbatim.
Solve
7m 46s
Wall-clock time in the container
Full test suite
No new failures
701 passed · 1 skipped · 702 total
Contamination audit
Clean
No sign the agent saw the real fix
Patch size
188vs 79 merged
Changed lines, ours vs merged
The issue
View on GitHubVue version
3.4.5
Link to minimal reproduction
https://stackblitz.com/edit/vitejs-vite-aob5zf?file=index.html
Steps to reproduce
I defined a Vue component with tagName as a property, and used that, together with defineCustomElement to define the hello-world webcomponent.