diff --git a/ext/web/02_event.js b/ext/web/02_event.js index 2be8003674..80dc4ffc7b 100644 --- a/ext/web/02_event.js +++ b/ext/web/02_event.js @@ -21,7 +21,6 @@ const { ArrayPrototypeSplice, ArrayPrototypeUnshift, Boolean, - DateNow, Error, FunctionPrototypeCall, MapPrototypeGet, @@ -123,8 +122,6 @@ const _inPassiveListener = Symbol("[[inPassiveListener]]"); const _dispatched = Symbol("[[dispatched]]"); const _isTrusted = Symbol("[[isTrusted]]"); const _path = Symbol("[[path]]"); -// internal. -const _skipInternalInit = Symbol("[[skipSlowInit]]"); class Event { constructor(type, eventInitDict = {}) { @@ -138,21 +135,6 @@ class Event { this[_isTrusted] = false; this[_path] = []; - if (eventInitDict?.[_skipInternalInit]) { - this[_attributes] = { - type, - data: eventInitDict.data ?? null, - bubbles: eventInitDict.bubbles ?? false, - cancelable: eventInitDict.cancelable ?? false, - composed: eventInitDict.composed ?? false, - currentTarget: null, - eventPhase: Event.NONE, - target: null, - timeStamp: 0, - }; - return; - } - webidl.requiredArguments( arguments.length, 1, @@ -172,7 +154,7 @@ class Event { currentTarget: null, eventPhase: Event.NONE, target: null, - timeStamp: DateNow(), + timeStamp: 0, }; } @@ -1205,7 +1187,6 @@ class MessageEvent extends Event { bubbles: eventInitDict?.bubbles ?? false, cancelable: eventInitDict?.cancelable ?? false, composed: eventInitDict?.composed ?? false, - [_skipInternalInit]: eventInitDict?.[_skipInternalInit], }); this.data = eventInitDict?.data ?? null; @@ -1494,7 +1475,6 @@ function reportError(error) { } export { - _skipInternalInit, CloseEvent, CustomEvent, defineEventHandler, diff --git a/ext/websocket/01_websocket.js b/ext/websocket/01_websocket.js index 71abb08303..bb1624f223 100644 --- a/ext/websocket/01_websocket.js +++ b/ext/websocket/01_websocket.js @@ -9,7 +9,6 @@ import * as webidl from "ext:deno_webidl/00_webidl.js"; import { HTTP_TOKEN_CODE_POINT_RE } from "ext:deno_web/00_infra.js"; import DOMException from "ext:deno_web/01_dom_exception.js"; import { - _skipInternalInit, CloseEvent, defineEventHandler, dispatch, @@ -450,7 +449,6 @@ class WebSocket extends EventTarget { const event = new MessageEvent("message", { data, origin: this[_url], - [_skipInternalInit]: true, }); setIsTrusted(event, true); dispatch(this, event);