Skip to content
This repository has been archived by the owner on Jul 1, 2021. It is now read-only.

Allow CustomEvent to be created #33

Merged
merged 2 commits into from Jan 8, 2019
Merged

Allow CustomEvent to be created #33

merged 2 commits into from Jan 8, 2019

Conversation

SheepFromHeaven
Copy link
Contributor

Currently basicHTML is throwing an error when using HyperHTML element as it uses hyperHTML which uses @ungap/custom-event to create custom events.

This invokes document.createEvent('CustomEvent') which is not handled by basicHTML.

I added the changes needed to make this possible.

@coveralls
Copy link

coveralls commented Jan 8, 2019

Coverage Status

Coverage remained the same at 100.0% when pulling 8857a2a on biotope:master into f37f07f on WebReflection:master.

@WebReflection
Copy link
Owner

Good catch, and good PR, however I'd like to keep the code coverage 100%.

Do you mind adding a test for that case too?

@WebReflection
Copy link
Owner

P.S. I guess all you have to do is to add the following:

var createdCE = document.createEvent('CustomEvent');
createdCE.initCustomEvent('custom', true, true, third);
first.dispatchEvent(createdCE);
assert(
  first.detail === third,
  'CustomEvent can be created procedurally'
);

after this block

@SheepFromHeaven
Copy link
Contributor Author

Yep, will do! 👍

@SheepFromHeaven
Copy link
Contributor Author

Good thing you did this. Found an actual error 🥇

@WebReflection
Copy link
Owner

Good thing you did this. Found an actual error

that's why I want to keep it 100% ;-) I'm used to little gotchas every single time I forget to add a test so thanks for adding it.

@WebReflection WebReflection merged commit 016ae1e into WebReflection:master Jan 8, 2019
@WebReflection
Copy link
Owner

up and running @ v0.21

@SheepFromHeaven
Copy link
Contributor Author

@WebReflection yay! will update

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants