<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[181871] trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/181871">181871</a></dd>
<dt>Author</dt> <dd>dino@apple.com</dd>
<dt>Date</dt> <dd>2015-03-23 14:37:53 -0700 (Mon, 23 Mar 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>ES7: Implement Array.prototype.includes
https://bugs.webkit.org/show_bug.cgi?id=142707

Reviewed by Geoffrey Garen.

Source/JavaScriptCore:

Add support for the ES7 includes method on Arrays.
https://github.com/tc39/Array.prototype.includes

* builtins/Array.prototype.js:
(includes): Implementation in JS.
* runtime/ArrayPrototype.cpp: Add 'includes' to the lookup table.

LayoutTests:

* js/array-includes-expected.txt: Added.
* js/array-includes.html: Added.
* js/script-tests/array-includes.js: Added.
* js/script-tests/Object-getOwnPropertyNames.js: Add 'includes'.
* js/Object-getOwnPropertyNames-expected.txt: Add 'includes'.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsjsObjectgetOwnPropertyNamesexpectedtxt">trunk/LayoutTests/js/Object-getOwnPropertyNames-expected.txt</a></li>
<li><a href="#trunkLayoutTestsjsscripttestsObjectgetOwnPropertyNamesjs">trunk/LayoutTests/js/script-tests/Object-getOwnPropertyNames.js</a></li>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCorebuiltinsArrayprototypejs">trunk/Source/JavaScriptCore/builtins/Array.prototype.js</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeArrayPrototypecpp">trunk/Source/JavaScriptCore/runtime/ArrayPrototype.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsjsarrayincludesexpectedtxt">trunk/LayoutTests/js/array-includes-expected.txt</a></li>
<li><a href="#trunkLayoutTestsjsarrayincludeshtml">trunk/LayoutTests/js/array-includes.html</a></li>
<li><a href="#trunkLayoutTestsjsscripttestsarrayincludesjs">trunk/LayoutTests/js/script-tests/array-includes.js</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (181870 => 181871)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2015-03-23 21:32:38 UTC (rev 181870)
+++ trunk/LayoutTests/ChangeLog        2015-03-23 21:37:53 UTC (rev 181871)
</span><span class="lines">@@ -1,3 +1,16 @@
</span><ins>+2015-03-23  Dean Jackson  &lt;dino@apple.com&gt;
+
+        ES7: Implement Array.prototype.includes
+        https://bugs.webkit.org/show_bug.cgi?id=142707
+
+        Reviewed by Geoffrey Garen.
+
+        * js/array-includes-expected.txt: Added.
+        * js/array-includes.html: Added.
+        * js/script-tests/array-includes.js: Added.
+        * js/script-tests/Object-getOwnPropertyNames.js: Add 'includes'.
+        * js/Object-getOwnPropertyNames-expected.txt: Add 'includes'.
+
</ins><span class="cx"> 2015-03-23  Joseph Pecoraro  &lt;pecoraro@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         __defineGetter__/__defineSetter__ should throw exceptions
</span></span></pre></div>
<a id="trunkLayoutTestsjsObjectgetOwnPropertyNamesexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/js/Object-getOwnPropertyNames-expected.txt (181870 => 181871)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/Object-getOwnPropertyNames-expected.txt        2015-03-23 21:32:38 UTC (rev 181870)
+++ trunk/LayoutTests/js/Object-getOwnPropertyNames-expected.txt        2015-03-23 21:37:53 UTC (rev 181871)
</span><span class="lines">@@ -45,7 +45,7 @@
</span><span class="cx"> PASS getSortedOwnPropertyNames(Function) is ['length', 'name', 'prototype']
</span><span class="cx"> PASS getSortedOwnPropertyNames(Function.prototype) is ['apply', 'bind', 'call', 'constructor', 'length', 'name', 'toString']
</span><span class="cx"> PASS getSortedOwnPropertyNames(Array) is ['from', 'isArray', 'length', 'name', 'of', 'prototype']
</span><del>-PASS getSortedOwnPropertyNames(Array.prototype) is ['concat', 'constructor', 'entries', 'every', 'fill', 'filter', 'find', 'findIndex', 'forEach', 'indexOf', 'join', 'keys', 'lastIndexOf', 'length', 'map', 'pop', 'push', 'reduce', 'reduceRight', 'reverse', 'shift', 'slice', 'some', 'sort', 'splice', 'toLocaleString', 'toString', 'unshift']
</del><ins>+PASS getSortedOwnPropertyNames(Array.prototype) is ['concat', 'constructor', 'entries', 'every', 'fill', 'filter', 'find', 'findIndex', 'forEach', 'includes', 'indexOf', 'join', 'keys', 'lastIndexOf', 'length', 'map', 'pop', 'push', 'reduce', 'reduceRight', 'reverse', 'shift', 'slice', 'some', 'sort', 'splice', 'toLocaleString', 'toString', 'unshift']
</ins><span class="cx"> PASS getSortedOwnPropertyNames(String) is ['fromCharCode', 'length', 'name', 'prototype']
</span><span class="cx"> PASS getSortedOwnPropertyNames(String.prototype) is ['anchor', 'big', 'blink', 'bold', 'charAt', 'charCodeAt', 'concat', 'constructor', 'endsWith', 'fixed', 'fontcolor', 'fontsize', 'includes', 'indexOf', 'italics', 'lastIndexOf', 'length', 'link', 'localeCompare', 'match', 'repeat', 'replace', 'search', 'slice', 'small', 'split', 'startsWith', 'strike', 'sub', 'substr', 'substring', 'sup', 'toLocaleLowerCase', 'toLocaleUpperCase', 'toLowerCase', 'toString', 'toUpperCase', 'trim', 'trimLeft', 'trimRight', 'valueOf']
</span><span class="cx"> PASS getSortedOwnPropertyNames(Boolean) is ['length', 'name', 'prototype']
</span></span></pre></div>
<a id="trunkLayoutTestsjsarrayincludesexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/js/array-includes-expected.txt (0 => 181871)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/array-includes-expected.txt                                (rev 0)
+++ trunk/LayoutTests/js/array-includes-expected.txt        2015-03-23 21:37:53 UTC (rev 181871)
</span><span class="lines">@@ -0,0 +1,35 @@
</span><ins>+Tests for Array.prototype.includes
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS [].includes.length is 1
+PASS [1, 2, 3].includes(2) is true
+PASS [1, 2, 3].includes(4) is false
+PASS [].includes(1) is false
+PASS [1, 2, 3].includes(1, 2) is false
+PASS [1, 2, 3].includes(3, 3) is false
+PASS [1, 2, 3].includes(2, undefined) is true
+PASS [1, 2, 3].includes(2, null) is true
+PASS [1, 2, 3].includes(2, 1, 2) is true
+PASS [1, 2, 3].includes(2, Number) is true
+PASS [1, 2, 3].includes(2, Number(2)) is false
+PASS [1, 2, 3].includes(2, 'egg') is true
+PASS [1, 2, 3].includes(2, '3') is false
+PASS [1, 2, 3].includes(3, -1) is true
+PASS [1, 2, 3].includes(1, -2) is false
+PASS [1, 2, 3].includes(1, -3) is true
+PASS [1, 2, NaN, 4].includes(NaN) is true
+PASS ['egg', 'bacon', 'sausage'].includes('egg') is true
+PASS ['egg', 'bacon', 'sausage'].includes('spinach') is false
+Array with holes
+PASS a.includes('egg') is true
+PASS a.includes('sausage') is true
+PASS a.includes('hashbrown') is false
+PASS a.includes('toast') is false
+PASS Array.prototype.includes.call(undefined, 1) threw exception TypeError: Array.prototype.includes requires that |this| not be undefined.
+PASS Array.prototype.includes.call(null, 1) threw exception TypeError: Array.prototype.includes requires that |this| not be null.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins><span class="cx">Property changes on: trunk/LayoutTests/js/array-includes-expected.txt
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<a id="svnkeywords"></a>
<div class="addfile"><h4>Added: svn:keywords</h4></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<a id="trunkLayoutTestsjsarrayincludeshtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/js/array-includes.html (0 => 181871)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/array-includes.html                                (rev 0)
+++ trunk/LayoutTests/js/array-includes.html        2015-03-23 21:37:53 UTC (rev 181871)
</span><span class="lines">@@ -0,0 +1,10 @@
</span><ins>+&lt;!DOCTYPE HTML&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;script src=&quot;script-tests/array-includes.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins><span class="cx">Property changes on: trunk/LayoutTests/js/array-includes.html
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<a id="svnkeywords"></a>
<div class="addfile"><h4>Added: svn:keywords</h4></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<a id="trunkLayoutTestsjsscripttestsObjectgetOwnPropertyNamesjs"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/js/script-tests/Object-getOwnPropertyNames.js (181870 => 181871)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/script-tests/Object-getOwnPropertyNames.js        2015-03-23 21:32:38 UTC (rev 181870)
+++ trunk/LayoutTests/js/script-tests/Object-getOwnPropertyNames.js        2015-03-23 21:37:53 UTC (rev 181871)
</span><span class="lines">@@ -53,7 +53,7 @@
</span><span class="cx">     &quot;Function&quot;: &quot;['length', 'name', 'prototype']&quot;,
</span><span class="cx">     &quot;Function.prototype&quot;: &quot;['apply', 'bind', 'call', 'constructor', 'length', 'name', 'toString']&quot;,
</span><span class="cx">     &quot;Array&quot;: &quot;['from', 'isArray', 'length', 'name', 'of', 'prototype']&quot;,
</span><del>-    &quot;Array.prototype&quot;: &quot;['concat', 'constructor', 'entries', 'every', 'fill', 'filter', 'find', 'findIndex', 'forEach', 'indexOf', 'join', 'keys', 'lastIndexOf', 'length', 'map', 'pop', 'push', 'reduce', 'reduceRight', 'reverse', 'shift', 'slice', 'some', 'sort', 'splice', 'toLocaleString', 'toString', 'unshift']&quot;,
</del><ins>+    &quot;Array.prototype&quot;: &quot;['concat', 'constructor', 'entries', 'every', 'fill', 'filter', 'find', 'findIndex', 'forEach', 'includes', 'indexOf', 'join', 'keys', 'lastIndexOf', 'length', 'map', 'pop', 'push', 'reduce', 'reduceRight', 'reverse', 'shift', 'slice', 'some', 'sort', 'splice', 'toLocaleString', 'toString', 'unshift']&quot;,
</ins><span class="cx">     &quot;String&quot;: &quot;['fromCharCode', 'length', 'name', 'prototype']&quot;,
</span><span class="cx">     &quot;String.prototype&quot;: &quot;['anchor', 'big', 'blink', 'bold', 'charAt', 'charCodeAt', 'concat', 'constructor', 'endsWith', 'fixed', 'fontcolor', 'fontsize', 'includes', 'indexOf', 'italics', 'lastIndexOf', 'length', 'link', 'localeCompare', 'match', 'repeat', 'replace', 'search', 'slice', 'small', 'split', 'startsWith', 'strike', 'sub', 'substr', 'substring', 'sup', 'toLocaleLowerCase', 'toLocaleUpperCase', 'toLowerCase', 'toString', 'toUpperCase', 'trim', 'trimLeft', 'trimRight', 'valueOf']&quot;,
</span><span class="cx">     &quot;Boolean&quot;: &quot;['length', 'name', 'prototype']&quot;,
</span></span></pre></div>
<a id="trunkLayoutTestsjsscripttestsarrayincludesjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/js/script-tests/array-includes.js (0 => 181871)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/script-tests/array-includes.js                                (rev 0)
+++ trunk/LayoutTests/js/script-tests/array-includes.js        2015-03-23 21:37:53 UTC (rev 181871)
</span><span class="lines">@@ -0,0 +1,45 @@
</span><ins>+description(&quot;Tests for Array.prototype.includes&quot;);
+
+shouldBe(&quot;[].includes.length&quot;, &quot;1&quot;);
+
+shouldBeTrue(&quot;[1, 2, 3].includes(2)&quot;);
+shouldBeFalse(&quot;[1, 2, 3].includes(4)&quot;);
+shouldBeFalse(&quot;[].includes(1)&quot;);
+
+shouldBeFalse(&quot;[1, 2, 3].includes(1, 2)&quot;);
+shouldBeFalse(&quot;[1, 2, 3].includes(3, 3)&quot;);
+shouldBeTrue(&quot;[1, 2, 3].includes(2, undefined)&quot;);
+shouldBeTrue(&quot;[1, 2, 3].includes(2, null)&quot;);
+shouldBeTrue(&quot;[1, 2, 3].includes(2, 1, 2)&quot;);
+shouldBeTrue(&quot;[1, 2, 3].includes(2, Number)&quot;);
+shouldBeFalse(&quot;[1, 2, 3].includes(2, Number(2))&quot;);
+shouldBeTrue(&quot;[1, 2, 3].includes(2, 'egg')&quot;);
+shouldBeFalse(&quot;[1, 2, 3].includes(2, '3')&quot;);
+
+shouldBeTrue(&quot;[1, 2, 3].includes(3, -1)&quot;);
+shouldBeFalse(&quot;[1, 2, 3].includes(1, -2)&quot;);
+shouldBeTrue(&quot;[1, 2, 3].includes(1, -3)&quot;);
+
+shouldBeTrue(&quot;[1, 2, NaN, 4].includes(NaN)&quot;);
+
+shouldBeTrue(&quot;['egg', 'bacon', 'sausage'].includes('egg')&quot;);
+shouldBeFalse(&quot;['egg', 'bacon', 'sausage'].includes('spinach')&quot;);
+
+debug(&quot;Array with holes&quot;);
+
+var a = [];
+a[0] = 'egg';
+a[1] = 'bacon';
+a[5] = 'sausage';
+a[6] = 'spinach';
+a[-2] = 'toast';
+
+shouldBeTrue(&quot;a.includes('egg')&quot;);
+shouldBeTrue(&quot;a.includes('sausage')&quot;);
+shouldBeFalse(&quot;a.includes('hashbrown')&quot;);
+shouldBeFalse(&quot;a.includes('toast')&quot;);
+
+shouldThrow(&quot;Array.prototype.includes.call(undefined, 1)&quot;);
+shouldThrow(&quot;Array.prototype.includes.call(null, 1)&quot;);
+
+
</ins><span class="cx">Property changes on: trunk/LayoutTests/js/script-tests/array-includes.js
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<a id="svnkeywords"></a>
<div class="addfile"><h4>Added: svn:keywords</h4></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (181870 => 181871)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog        2015-03-23 21:32:38 UTC (rev 181870)
+++ trunk/Source/JavaScriptCore/ChangeLog        2015-03-23 21:37:53 UTC (rev 181871)
</span><span class="lines">@@ -1,3 +1,17 @@
</span><ins>+2015-03-23  Dean Jackson  &lt;dino@apple.com&gt;
+
+        ES7: Implement Array.prototype.includes
+        https://bugs.webkit.org/show_bug.cgi?id=142707
+
+        Reviewed by Geoffrey Garen.
+
+        Add support for the ES7 includes method on Arrays.
+        https://github.com/tc39/Array.prototype.includes
+
+        * builtins/Array.prototype.js:
+        (includes): Implementation in JS.
+        * runtime/ArrayPrototype.cpp: Add 'includes' to the lookup table.
+
</ins><span class="cx"> 2015-03-23  Joseph Pecoraro  &lt;pecoraro@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         __defineGetter__/__defineSetter__ should throw exceptions
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebuiltinsArrayprototypejs"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/builtins/Array.prototype.js (181870 => 181871)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/builtins/Array.prototype.js        2015-03-23 21:32:38 UTC (rev 181870)
+++ trunk/Source/JavaScriptCore/builtins/Array.prototype.js        2015-03-23 21:37:53 UTC (rev 181871)
</span><span class="lines">@@ -236,3 +236,40 @@
</span><span class="cx">     }
</span><span class="cx">     return -1;
</span><span class="cx"> }
</span><ins>+
+function includes(searchElement /*, fromIndex*/) {
+    &quot;use strict&quot;;
+    if (this === null)
+        throw new @TypeError(&quot;Array.prototype.includes requires that |this| not be null&quot;);
+
+    if (this === undefined)
+        throw new @TypeError(&quot;Array.prototype.includes requires that |this| not be undefined&quot;);
+
+    var array = @Object(this);
+    var length = array.length &gt;&gt;&gt; 0;
+
+    if (length === 0)
+        return false;
+
+    var fromIndex = 0;
+    if (arguments.length &gt; 1 &amp;&amp; arguments[1] !== undefined)
+        fromIndex = arguments[1] | 0;
+
+    var index;
+    if (fromIndex &gt;= 0)
+        index = fromIndex;
+    else
+        index = length + fromIndex;
+
+    if (index &lt; 0)
+        index = 0;
+
+    var currentElement;
+    for (; index &lt; length; ++index) {
+        currentElement = array[index];
+        // Use SameValueZero comparison, rather than just StrictEquals.
+        if (searchElement === currentElement || (searchElement !== searchElement &amp;&amp; currentElement !== currentElement))
+            return true;
+    }
+    return false;
+}
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeArrayPrototypecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/ArrayPrototype.cpp (181870 => 181871)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/ArrayPrototype.cpp        2015-03-23 21:32:38 UTC (rev 181870)
+++ trunk/Source/JavaScriptCore/runtime/ArrayPrototype.cpp        2015-03-23 21:37:53 UTC (rev 181871)
</span><span class="lines">@@ -117,6 +117,7 @@
</span><span class="cx">   keys           arrayProtoFuncKeys           DontEnum|Function 0
</span><span class="cx">   find           arrayProtoFuncFind           DontEnum|Function 1
</span><span class="cx">   findIndex      arrayProtoFuncFindIndex      DontEnum|Function 1
</span><ins>+  includes       arrayProtoFuncIncludes       DontEnum|Function 1
</ins><span class="cx"> @end
</span><span class="cx"> */
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>