Skip to content

Commit

Permalink
fix(event): use Object.defineProperty (#115)
Browse files Browse the repository at this point in the history
  • Loading branch information
ykzts committed Jul 28, 2020
1 parent cc2d208 commit f765c4d
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/dom/event.ts
Expand Up @@ -117,9 +117,13 @@ export default class Event {
constructor(type: string, eventInit: EventInit = {}) {
if (!type) throw new TypeError('Not enough arguments.');

this[internalEventSymbol] = new InternalEvent(type, {
bubbles: eventInit.bubbles ?? false,
cancelable: eventInit.cancelable ?? false
Object.defineProperty(this, internalEventSymbol, {
enumerable: false,
value: new InternalEvent(type, {
bubbles: eventInit.bubbles ?? false,
cancelable: eventInit.cancelable ?? false
}),
writable: true
});
}

Expand Down

0 comments on commit f765c4d

Please sign in to comment.