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

Remove unneeded isPlainObject function #64

Merged
merged 1 commit into from
Apr 17, 2017

Conversation

david-mark
Copy link
Contributor

@david-mark david-mark commented Dec 26, 2016

It's the function caller's responsibility to pass the expected argument type. If they pass something "truthy" that is not an Object object, then the behavior of the function is undefined. We shouldn't work around such mistakes by the caller. What did they mean to pass for the argument? And why should we care if the Object object is of the "plain" variety?

This pull request is just a half step in the right direction. A better solution would be to throw an exception on receiving incorrect arguments.

It's the function caller's responsibility to pass the expected argument type. If they pass something "truthy" that is not an Object object, then the behavior of the function is undefined. We shouldn't work around such mistakes by the caller (i.e. what did they mean to pass for the argument?) and why should we care if the Object object is of the "plain" variety.

This pull request is just a half step in the right direction. A better solution would be to throw an exception on receiving incorrect arguments.
@aslakhellesoy
Copy link
Contributor

See #69

@rexxars rexxars merged commit fde8582 into EventSource:master Apr 17, 2017
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.

3 participants