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

isFunction is set incorrectly inside context._get #423

Closed
prashn64 opened this issue Feb 16, 2014 · 2 comments
Closed

isFunction is set incorrectly inside context._get #423

prashn64 opened this issue Feb 16, 2014 · 2 comments

Comments

@prashn64
Copy link
Contributor

isFunction is meant to be true only on non dust functions. isFunction is set on all functions inside this _get, but a dust body function could be returned by _get.

One issue this causes is calling a dust body function with no parameters in dust.helpers.tap, when dust functions expect a chunk and a context.

@kate2753
Copy link
Contributor

Implementation of dust.helpers.tap was changed not to rely on isFunction flag. Are there any other cases we need to worry about? Can we remove this flag from core?

Based on the way isFunction flag is currently implemented, we can use typeof foo === 'function' instead.

@prashn64
Copy link
Contributor Author

isFunction isn't used anywhere else in the core or helpers. You could argue that someone may be relying on that flag, but I highly doubt it since it's undocumented, and has an ambiguous name. If anyone feels strongly about it, we can roll it out as a deprecation and then remove it, but I'm all for just removing it.

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

3 participants