array-includes
Advanced tools
Comparing version 1.1.1 to 2.0.0
@@ -0,1 +1,5 @@ | ||
2.0.0 / 2015-05-23 | ||
================= | ||
* Fix to not skip holes, per https://github.com/tc39/Array.prototype.includes/issues/15 | ||
1.1.1 / 2015-05-23 | ||
@@ -2,0 +6,0 @@ ================= |
@@ -10,3 +10,3 @@ 'use strict'; | ||
var fromIndex = arguments.length > 1 ? ES.ToInteger(arguments[1]) : 0; | ||
if (Array.prototype.indexOf && !$isNaN(searchElement) && $isFinite(fromIndex)) { | ||
if (Array.prototype.indexOf && !$isNaN(searchElement) && $isFinite(fromIndex) && typeof searchElement !== 'undefined') { | ||
return Array.prototype.indexOf.apply(this, arguments) > -1; | ||
@@ -13,0 +13,0 @@ } |
{ | ||
"name": "array-includes", | ||
"version": "1.1.1", | ||
"version": "2.0.0", | ||
"author": "Jordan Harband", | ||
@@ -5,0 +5,0 @@ "description": "A spec-compliant `Array.prototype.includes` shim/polyfill/replacement that works as far down as ES3.", |
@@ -7,2 +7,14 @@ module.exports = function (includes, t) { | ||
t.test('simple examples', function (st) { | ||
st.equal(true, includes([1, 2, 3], 1), '[1, 2, 3] includes 1'); | ||
st.equal(false, includes([1, 2, 3], 4), '[1, 2, 3] does not include 4'); | ||
st.equal(true, includes([NaN], NaN), '[NaN] includes NaN'); | ||
st.end(); | ||
}); | ||
t.test('does not skip holes', function (st) { | ||
st.equal(true, includes(Array(1)), 'Array(1) includes undefined'); | ||
st.end(); | ||
}); | ||
t.test('exceptions', function (et) { | ||
@@ -9,0 +21,0 @@ et.test('fromIndex conversion', function (st) { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
25782
215