Title: zone.js: patched addEventListener drops options exposed as accessors or non-enumerable properties · Issue #70431 · angular/angular · GitHub
Open Graph Title: zone.js: patched addEventListener drops options exposed as accessors or non-enumerable properties · Issue #70431 · angular/angular
X Title: zone.js: patched addEventListener drops options exposed as accessors or non-enumerable properties · Issue #70431 · angular/angular
Description: Which @angular/* package(s) are the source of the bug? zone.js Is this a regression? Yes. Introduced in zone.js 0.14.7 (June 2024) by #55796 / 85c1719. Bisected: 0.13.3, 0.14.0, 0.14.4, 0.14.6 all behave correctly; 0.14.7 → 0.16.2 do not...
Open Graph Description: Which @angular/* package(s) are the source of the bug? zone.js Is this a regression? Yes. Introduced in zone.js 0.14.7 (June 2024) by #55796 / 85c1719. Bisected: 0.13.3, 0.14.0, 0.14.4, 0.14.6 all ...
X Description: Which @angular/* package(s) are the source of the bug? zone.js Is this a regression? Yes. Introduced in zone.js 0.14.7 (June 2024) by #55796 / 85c1719. Bisected: 0.13.3, 0.14.0, 0.14.4, 0.14.6 all ...
Opengraph URL: https://github.com/angular/angular/issues/70431
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"zone.js: patched addEventListener drops options exposed as accessors or non-enumerable properties","articleBody":"### Which @angular/* package(s) are the source of the bug?\n\nzone.js\n\n### Is this a regression?\n\nYes. Introduced in **zone.js 0.14.7** (June 2024) by [#55796](https://github.com/angular/angular/pull/55796) / [`85c1719`](https://github.com/angular/angular/commit/85c171920ae2b1861896fa6c2d5d7dc8f030a445). Bisected: 0.13.3, 0.14.0, 0.14.4, 0.14.6 all behave correctly; 0.14.7 → 0.16.2 do not.\n\n### Description\n\n`copyEventListenerOptions` in `packages/zone.js/lib/common/events.ts` copies the caller's options object with `{...options}` before forwarding it to native `addEventListener`. Object spread copies only **own enumerable data properties**. The native call, by contrast, reads dictionary members via WebIDL — a plain `[[Get]]` per member, which honours accessors and ignores enumerability. The copy is therefore lossy in a way the native call is not.\n\n`signal` was already special-cased after it broke WalletConnect (see #54142). `passive`, `capture`, and `once` were not, and are silently dropped in the same circumstances.\n\nObserved in Chromium against zone.js 0.15.1:\n\n| option supplied as an accessor | without zone.js | with zone.js |\n|---|---|---|\n| `capture: true` | capture phase (`eventPhase === 1`) | bubbling phase (3) |\n| `once: true` | fires once | fires every time |\n| `passive` getter (feature-detection probe) | getter invoked | never invoked |\n| same options as a plain object literal | honoured | honoured |\n\nNothing throws in any case.\n\nThe `passive` row is the one with ecosystem-wide fallout: it defeats the [MDN feature test for passive-listener support](https://devdoc.net/web/developer.mozilla.org/en-US/docs/Web/API/EventTarget.addEventListener.html), where *the getter being read* is the signal. That snippet is used verbatim by Highcharts (See: https://github.com/highcharts/highcharts/blob/69edf8952a04b9872b6510fbdacd7dff8b03970b/ts/Core/Globals.ts#L201). Making every listener they register non-passive. Including ones they explicitly intended to be passive.\n\n### Please provide a link to a minimal reproduction of the bug\n\nStandalone HTML, no framework or build:\n\n```html\n\u003cscript src=\"https://unpkg.com/zone.js@0.15.1/bundles/zone.umd.js\">\u003c/script>\n\u003cscript>\n let supported = false;\n window.addEventListener('probe', function () {},\n Object.defineProperty({}, 'passive', { get: () => { supported = true; return false; } }));\n console.log('passive detected:', supported);\n\n const inner = document.createElement('button');\n document.body.append(inner);\n document.body.addEventListener('click', e => console.log('phase:', e.eventPhase),\n Object.defineProperty({}, 'capture', { get: () => true }));\n inner.click();\n\u003c/script>\n```\n\n### Please provide the exception or error you saw\n\nNone — silent loss of options.\n\n### Please provide the environment you discovered this bug in (run \\`ng version\\`)\n\nReproduced against published zone.js 0.13.3 → 0.16.2 in headless Chromium.\n\n### Anything else?\n\nThe copy itself was the correct fix for #54142 (frozen/readonly options). The defect is that the copy is lossy, not that it exists — reverting to mutation would re-introduce #54142.\n\nA fix is ready and will be sent as a PR that references this issue.","author":{"url":"https://github.com/stefanwaldhauser","@type":"Person","name":"stefanwaldhauser"},"datePublished":"2026-08-27T14:00:10Z","url":"https://github.com/angular/angular/issues/70431"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:7b04f286-89e8-f4c5-1594-63011b52a727 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C28C:1CEA6F:1487821:1B180FF:6B01235B |
| html-safe-nonce | 427dfa365b0d92ef7f77d58b676e0d58fd8b4acb18aad91670260442041a9733 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDMjhDOjFDRUE2RjoxNDg3ODIxOjFCMTgwRkY6NkIwMTIzNUIiLCJ2aXNpdG9yX2lkIjoiNjYxMjYxMTM5OTY2OTU4ODgyNyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | be9d2413041571bc679adb610fd8dd615246ccc4c874778373e7b1962b81cf49 |
| hovercard-subject-tag | issue:5268386387 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/angular/angular/70431/issue_layout |
| twitter:image | https://opengraph.githubassets.com/0580c9f6b6a9f6ed0a16879a10d008fcc2571fdb3520220519306bacce70915d/angular/angular/issues/70431 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/0580c9f6b6a9f6ed0a16879a10d008fcc2571fdb3520220519306bacce70915d/angular/angular/issues/70431 |
| og:image:alt | Which @angular/* package(s) are the source of the bug? zone.js Is this a regression? Yes. Introduced in zone.js 0.14.7 (June 2024) by #55796 / 85c1719. Bisected: 0.13.3, 0.14.0, 0.14.4, 0.14.6 all ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | stefanwaldhauser |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| turbo-cache-control | no-preview |
| go-import | github.com/angular/angular git https://github.com/angular/angular.git |
| octolytics-dimension-user_id | 139426 |
| octolytics-dimension-user_login | angular |
| octolytics-dimension-repository_id | 24195339 |
| octolytics-dimension-repository_nwo | angular/angular |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 24195339 |
| octolytics-dimension-repository_network_root_nwo | angular/angular |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width