Index: src/js/typedarray.js |
diff --git a/src/js/typedarray.js b/src/js/typedarray.js |
index 15bc7296624036a65d3d6d185a325a491dbb1f5b..8e7d9ee77e4ed3c8011e400c490e132cf6ef1664 100644 |
--- a/src/js/typedarray.js |
+++ b/src/js/typedarray.js |
@@ -28,6 +28,7 @@ |
var InnerArrayFind; |
var InnerArrayFindIndex; |
var InnerArrayForEach; |
+var InnerArrayIncludes; |
var InnerArrayIndexOf; |
var InnerArrayJoin; |
var InnerArrayLastIndexOf; |
@@ -81,6 +82,7 @@ |
InnerArrayFind = from.InnerArrayFind; |
InnerArrayFindIndex = from.InnerArrayFindIndex; |
InnerArrayForEach = from.InnerArrayForEach; |
+ InnerArrayIncludes = from.InnerArrayIncludes; |
InnerArrayIndexOf = from.InnerArrayIndexOf; |
InnerArrayJoin = from.InnerArrayJoin; |
InnerArrayLastIndexOf = from.InnerArrayLastIndexOf; |
@@ -711,29 +713,7 @@ |
var length = %_TypedArrayGetLength(this); |
- if (length === 0) return false; |
- var n = TO_INTEGER(fromIndex); |
- |
- var k; |
- if (n >= 0) { |
- k = n; |
- } else { |
- k = length + n; |
- if (k < 0) { |
- k = 0; |
- } |
- } |
- |
- while (k < length) { |
- var elementK = this[k]; |
- if (%SameValueZero(searchElement, elementK)) { |
- return true; |
- } |
- |
- ++k; |
- } |
- |
- return false; |
+ return InnerArrayIncludes(searchElement, fromIndex, this, length); |
} |
%FunctionSetLength(TypedArrayIncludes, 1); |