Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check Event constructor params #1997

Merged
merged 2 commits into from
Mar 26, 2019
Merged

Conversation

justjavac
Copy link
Contributor

fix 2 bugs:

  1. Event requires at least 1 argument
  2. Convert the parameter type to string

Chrome:

const event = new Event()
// TypeError: Failed to construct 'Event': 1 argument required, but only 0 present.

Firefox:

const event = new Event()
// TypeError: Event requires at least 1 argument, but only 0 were passed

Deno(Before fixed):

const event = new Event()
event.type === undefined

after fixed:

const event = new Event()
// TypeError: Event requires at least 1 argument, but only 0 present

Before fixed:

const event = new Event(null)
event.type === null  // true

After fixed:

const event = new Event(null)
event.type === null    // false
event.type === "null"  // true

Copy link
Member

@ry ry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - thanks!

@ry ry merged commit ed2977d into denoland:master Mar 26, 2019
@justjavac justjavac deleted the check-event-params branch March 28, 2019 01:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants