diff options
author | Kenta Moriuchi <moriken@kimamass.com> | 2024-09-06 19:52:59 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-06 12:52:59 +0200 |
commit | f0a3d206422af3177e0f36ed22802c1ccc6f7654 (patch) | |
tree | 57ad718cc47b7b98c0bbd869d6c070adee3bf30a /ext/web/02_event.js | |
parent | 8ef08f1d294dbe7e3771202084ecbede73ca28aa (diff) |
fix(runtime): use more null proto objects again (#25040)
proceed with #23921
This PR is a preparation for
https://github.com/denoland/deno_lint/pull/1307
---------
Signed-off-by: Kenta Moriuchi <moriken@kimamass.com>
Co-authored-by: Luca Casonato <hello@lcas.dev>
Diffstat (limited to 'ext/web/02_event.js')
-rw-r--r-- | ext/web/02_event.js | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/ext/web/02_event.js b/ext/web/02_event.js index 985578bcc..f031d0aed 100644 --- a/ext/web/02_event.js +++ b/ext/web/02_event.js @@ -392,6 +392,7 @@ const EventPrototype = Event.prototype; // Not spec compliant. The spec defines it as [LegacyUnforgeable] // but doing so has a big performance hit ReflectDefineProperty(Event.prototype, "isTrusted", { + __proto__: null, enumerable: true, get: isTrusted, }); @@ -402,7 +403,10 @@ function defineEnumerableProps( ) { for (let i = 0; i < props.length; ++i) { const prop = props[i]; - ReflectDefineProperty(Ctor.prototype, prop, { enumerable: true }); + ReflectDefineProperty(Ctor.prototype, prop, { + __proto__: null, + enumerable: true, + }); } } @@ -1274,6 +1278,7 @@ class CustomEvent extends Event { const CustomEventPrototype = CustomEvent.prototype; ReflectDefineProperty(CustomEvent.prototype, "detail", { + __proto__: null, enumerable: true, }); @@ -1417,6 +1422,7 @@ function defineEventHandler( ) { // HTML specification section 8.1.7.1 ObjectDefineProperty(emitter, `on${name}`, { + __proto__: null, get() { if (!this[_eventHandlers]) { return null; |