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

Generator Functions #19

Open
devmckeon opened this issue Sep 20, 2018 · 4 comments
Open

Generator Functions #19

devmckeon opened this issue Sep 20, 2018 · 4 comments

Comments

@devmckeon
Copy link

devmckeon commented Sep 20, 2018

I don't think your implementation of isFunction, considers generator functions. I think you should probably do a test for (typeof x==='function') first, instead of only looking at the to string output and looking for regular and async function types.
Unless of course, this is intentional... in which case I would recommend adding that intention to the documentation.
Regardless, you may want to consider adding an isGenerator test. =)

@balupton
Copy link
Member

balupton commented Sep 20, 2018

I think the issue is that sometimes functions can be returned as objects via typeof (like es5 class workarounds). Hence why Object.prototype.toString.call(function () {}) is used, which isn't the same as (function () {}).toString(). Perhaps this behaviour is more reliable now (ecmascript has certainly refined itself over the years). Can you send me a fixture for generator functions, that I should test for.

@balupton
Copy link
Member

balupton commented Nov 27, 2018

I am currently preoccupied with tasks with revenue potential as my finances have depleted, so FOSS issues have been pushed to the backburner. If you want to speed them up on my queue, then consider making them a paid task by posting a bounty, as currently I earn nothing from my open-source work, so it cannot be a priority. Details for posting a bounty on this issue to incentivise its accomplishment sooner can be found here: https://bevry.me/bounties/

Otherwise a pull request will be the best means.

@balupton
Copy link
Member

PR welcome

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

No branches or pull requests

2 participants