Skip to content

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