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

Use the @options.smooth directly if the value's type is "boolean". #266

Merged
merged 1 commit into from
Oct 12, 2013

Conversation

usualoma
Copy link

@options.smooth is true or @options.ykeys[i] in @options.smooth

This code is compiled to

var __indexOf = [].indexOf;
typeof this.options.smooth === "boolean" ? this.options.smooth : (_ref1 = this.options.ykeys[i], __indexOf.call(this.options.smooth, _ref1) >= 0);

In modern browsers or in v8, [].indexOf.call(false, value) returns -1.
But, if Array.prototype.indexOf is implemented (often in IE8) by user, that code sometimes makes error.

I think that should check by typeof @options.smooth is "boolean", instead of is true.

@oesmith
Copy link
Contributor

oesmith commented Oct 12, 2013

Great work, thanks!

oesmith added a commit that referenced this pull request Oct 12, 2013
Use the @options.smooth directly if the value's type is "boolean".
@oesmith oesmith merged commit 4345fa3 into morrisjs:master Oct 12, 2013
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