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

close must receive a function or a falsey value #33

Merged
merged 3 commits into from
Nov 10, 2017

Conversation

mcollina
Copy link
Member

@mcollina mcollina commented Nov 9, 2017

If calling .close() with a non-function, throw.

@mcollina mcollina requested a review from delvedor November 9, 2017 23:44
boot.js Outdated
@@ -207,6 +219,9 @@ Boot.prototype.onClose = function (func) {
Boot.prototype.close = function (func) {
this._error = null
if (func) {
if (func && typeof func !== 'function') {
Copy link
Member

Choose a reason for hiding this comment

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

Here just the typeof is enough.

@mcollina mcollina merged commit c2172a1 into master Nov 10, 2017
@mcollina mcollina deleted the close-function-or-undefined branch November 10, 2017 22:11
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.

2 participants