Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(701)

Unified Diff: src/js/typedarray.js

Issue 2732823002: [typedarrays] Move %TypedArray%.prototype.includes to C++ builtins (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/builtins/builtins-typedarray.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/js/typedarray.js
diff --git a/src/js/typedarray.js b/src/js/typedarray.js
index 70bc14a8b042c146a0c027c76fc5910941e06879..bfbcef60599275725ffb731301cdbfc0b20f389d 100644
--- a/src/js/typedarray.js
+++ b/src/js/typedarray.js
@@ -717,39 +717,6 @@ function TypedArraySlice(start, end) {
}
-// ES2016 draft, section 22.2.3.14
-function TypedArrayIncludes(searchElement, fromIndex) {
- if (!IS_TYPEDARRAY(this)) throw %make_type_error(kNotTypedArray);
-
- 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;
-}
-%FunctionSetLength(TypedArrayIncludes, 1);
-
-
// ES6 draft 08-24-14, section 22.2.2.2
function TypedArrayOf() {
var length = arguments.length;
@@ -830,7 +797,6 @@ utils.InstallFunctions(GlobalTypedArray.prototype, DONT_ENUM, [
"filter", TypedArrayFilter,
"find", TypedArrayFind,
"findIndex", TypedArrayFindIndex,
- "includes", TypedArrayIncludes,
"indexOf", TypedArrayIndexOf,
"join", TypedArrayJoin,
"lastIndexOf", TypedArrayLastIndexOf,
« no previous file with comments | « src/builtins/builtins-typedarray.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698