Skip to content

Commit

Permalink
Check CustomEvent constructor params (denoland#2011)
Browse files Browse the repository at this point in the history
  • Loading branch information
justjavac authored and ry committed Mar 28, 2019
1 parent 8ac36d8 commit 1fec34b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion js/custom_event.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright 2018 the Deno authors. All rights reserved. MIT license.
import * as domTypes from "./dom_types";
import * as event from "./event";
import { getPrivateValue } from "./util";
import { getPrivateValue, requiredArguments } from "./util";

// WeakMaps are recommended for private attributes (see MDN link below)
// https://developer.mozilla.org/en-US/docs/Archive/Add-ons/Add-on_SDK/Guides/Contributor_s_Guide/Private_Properties#Using_WeakMaps
Expand All @@ -28,6 +28,7 @@ export class CustomEvent extends event.Event implements domTypes.CustomEvent {
type: string,
customEventInitDict: domTypes.CustomEventInit = {}
) {
requiredArguments("CustomEvent", arguments.length, 1);
super(type, customEventInitDict);
const { detail = null } = customEventInitDict;
customEventAttributes.set(this, { detail });
Expand Down

0 comments on commit 1fec34b

Please sign in to comment.