<!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>[190367] 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/190367">190367</a></dd>
<dt>Author</dt> <dd>keith_miller@apple.com</dd>
<dt>Date</dt> <dd>2015-09-30 14:00:42 -0700 (Wed, 30 Sep 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>[ES6] Add TypedArray.prototype functionality.
https://bugs.webkit.org/show_bug.cgi?id=148035

Reviewed by Geoffrey Garen.

Source/JavaScriptCore:

This patch should add most of the functionality for
the prototype properties of TypedArray objects in ES6.
There are a few exceptions to this, which will be added
in upcoming patches:

1) First we do not use the species constructor for some
of the TypedArray prototype functions (namely: map, filter,
slice, and subarray). That will need to be added when
species constructors are finished.

2) TypedArrays still have a length, byteOffset, byteLength,
and buffer are still attached to the TypedArray instance (in
the spec they are on the TypedArray.prototype instance object)
since the JIT currently assumes those properties are fixed.

3) The TypedArray.constructor property is not added yet
as it should point to the TypedArray instance object,
which will be added in a future patch.

* CMakeLists.txt:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters:
* JavaScriptCore.xcodeproj/project.pbxproj:
* builtins/TypedArray.prototype.js: Added.
(every):
(find):
(findIndex):
(forEach):
(some):
(sort.min):
(sort.merge):
(sort.mergeSort):
(sort):
(reduce):
(reduceRight):
(map):
(filter):
(toLocaleString):
* runtime/ArrayPrototype.cpp:
* runtime/ArrayPrototype.h:
* runtime/CommonIdentifiers.h:
* runtime/JSGenericTypedArrayView.h:
(JSC::JSGenericTypedArrayView::toAdaptorNativeFromValue):
(JSC::JSGenericTypedArrayView::setRangeToValue):
(JSC::JSGenericTypedArrayView::sort):
(JSC::JSGenericTypedArrayView::purifyArray):
(JSC::JSGenericTypedArrayView::sortComparison):
(JSC::JSGenericTypedArrayView::sortFloat):
* runtime/JSGenericTypedArrayViewInlines.h:
* runtime/JSGenericTypedArrayViewPrototypeFunctions.h: Added.
(JSC::argumentClampedIndexFromStartOrEnd):
(JSC::genericTypedArrayViewProtoFuncSet):
(JSC::genericTypedArrayViewProtoFuncEntries):
(JSC::genericTypedArrayViewProtoFuncCopyWithin):
(JSC::genericTypedArrayViewProtoFuncFill):
(JSC::genericTypedArrayViewProtoFuncIndexOf):
(JSC::genericTypedArrayViewProtoFuncJoin):
(JSC::genericTypedArrayViewProtoFuncKeys):
(JSC::genericTypedArrayViewProtoFuncLastIndexOf):
(JSC::genericTypedArrayViewProtoGetterFuncLength):
(JSC::genericTypedArrayViewProtoGetterFuncByteLength):
(JSC::genericTypedArrayViewProtoGetterFuncByteOffset):
(JSC::genericTypedArrayViewProtoFuncReverse):
(JSC::genericTypedArrayViewPrivateFuncSort):
(JSC::genericTypedArrayViewProtoFuncSlice):
(JSC::genericTypedArrayViewProtoFuncSubarray):
(JSC::typedArrayViewProtoFuncValues):
* runtime/JSGenericTypedArrayViewPrototypeInlines.h:
(JSC::JSGenericTypedArrayViewPrototype&lt;ViewClass&gt;::finishCreation):
(JSC::genericTypedArrayViewProtoFuncSet): Deleted.
(JSC::genericTypedArrayViewProtoFuncSubarray): Deleted.
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init):
* runtime/JSObject.h:
* runtime/JSTypedArrayPrototypes.cpp:
* runtime/JSTypedArrayPrototypes.h:
* runtime/JSTypedArrayViewPrototype.cpp: Added.
(JSC::typedArrayViewPrivateFuncLength):
(JSC::typedArrayViewPrivateFuncSort):
(JSC::typedArrayViewProtoFuncSet):
(JSC::typedArrayViewProtoFuncEntries):
(JSC::typedArrayViewProtoFuncCopyWithin):
(JSC::typedArrayViewProtoFuncFill):
(JSC::typedArrayViewProtoFuncLastIndexOf):
(JSC::typedArrayViewProtoFuncIndexOf):
(JSC::typedArrayViewProtoFuncJoin):
(JSC::typedArrayViewProtoFuncKeys):
(JSC::typedArrayViewProtoGetterFuncLength):
(JSC::typedArrayViewProtoGetterFuncByteLength):
(JSC::typedArrayViewProtoGetterFuncByteOffset):
(JSC::typedArrayViewProtoFuncReverse):
(JSC::typedArrayViewProtoFuncSubarray):
(JSC::typedArrayViewProtoFuncSlice):
(JSC::typedArrayViewProtoFuncValues):
(JSC::JSTypedArrayViewPrototype::JSTypedArrayViewPrototype):
(JSC::JSTypedArrayViewPrototype::finishCreation):
(JSC::JSTypedArrayViewPrototype::create):
(JSC::JSTypedArrayViewPrototype::createStructure):
* runtime/JSTypedArrayViewPrototype.h: Copied from Source/JavaScriptCore/runtime/JSTypedArrayPrototypes.cpp.
* tests/stress/resources/standalone-pre.js: Added.
(description):
(debug):
(escapeString):
(testPassed):
(testFailed):
(areNumbersEqual):
(areArraysEqual):
(isMinusZero):
(isTypedArray):
(isResultCorrect):
(stringify):
(shouldBe):
(dfgShouldBe):
(shouldBeType):
(shouldBeTrue):
(shouldBeFalse):
(shouldBeNaN):
(shouldBeNull):
(shouldBeEqualToString):
(shouldBeUndefined):
(shouldNotThrow):
(shouldThrow):
(dfgCompiled):
(dfgIncrement):
(noInline):
(finishJSTest):
* tests/stress/resources/typedarray-test-helper-functions.js: Added.
(forEachTypedArray):
(isSameFunctionForEachTypedArrayPrototype.eq):
(isSameFunctionForEachTypedArrayPrototype):
(hasSameValues):
(.foo):
(testPrototypeFunctionHelper):
(testPrototypeFunctionOnSigned):
(testPrototypeFunctionOnFloat):
(testPrototypeFunction):
(.tester):
(testPrototypeReceivesArray):
* tests/stress/typedarray-copyWithin.js: Added.
* tests/stress/typedarray-every.js: Added.
(isBigEnough):
(isBigEnoughAndChange):
(isBigEnoughAndException):
* tests/stress/typedarray-fill.js: Added.
* tests/stress/typedarray-filter.js: Added.
(keepEven):
(keepEvenAndChange):
(isBigEnoughAndException):
* tests/stress/typedarray-find.js: Added.
(keepEven):
(keepEvenAndChange):
(isBigEnoughAndException):
* tests/stress/typedarray-findIndex.js: Added.
(keepEven):
(keepEvenAndChange):
(isBigEnoughAndException):
* tests/stress/typedarray-forEach.js: Added.
(.checkCorrect.let.list):
(.checkCorrect):
(createChecker):
(foo):
(changeArray):
(isBigEnoughAndException):
* tests/stress/typedarray-indexOf.js: Added.
(keepEven):
* tests/stress/typedarray-lastIndexOf.js: Added.
* tests/stress/typedarray-map.js: Added.
(even):
(evenAndChange):
(isBigEnoughAndException):
* tests/stress/typedarray-reduce.js: Added.
(createArray):
(sum):
(createArrayAndChange):
(isBigEnoughAndException):
* tests/stress/typedarray-reduceRight.js: Added.
(createArray):
(sum):
(createArrayAndChange):
(isBigEnoughAndException):
* tests/stress/typedarray-slice.js: Added.
* tests/stress/typedarray-some.js: Added.
(isBigEnough):
(isBigEnoughAndChange):
(isBigEnoughAndException):
* tests/stress/typedarray-sort.js: Added.
(sortBackwards):
(compareException):

LayoutTests:

Fixed tests for new toString behavior on TypedArrays.

* fast/canvas/webgl/type-conversion-test-expected.txt:
* fast/dom/Window/window-postmessage-clone-expected.txt:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsfastcanvaswebgltypeconversiontestexpectedtxt">trunk/LayoutTests/fast/canvas/webgl/type-conversion-test-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastdomWindowwindowpostmessagecloneexpectedtxt">trunk/LayoutTests/fast/dom/Window/window-postmessage-clone-expected.txt</a></li>
<li><a href="#trunkSourceJavaScriptCoreCMakeListstxt">trunk/Source/JavaScriptCore/CMakeLists.txt</a></li>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCoreJavaScriptCorevcxprojJavaScriptCorevcxproj">trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj</a></li>
<li><a href="#trunkSourceJavaScriptCoreJavaScriptCorevcxprojJavaScriptCorevcxprojfilters">trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters</a></li>
<li><a href="#trunkSourceJavaScriptCoreJavaScriptCorexcodeprojprojectpbxproj">trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeArrayPrototypecpp">trunk/Source/JavaScriptCore/runtime/ArrayPrototype.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeArrayPrototypeh">trunk/Source/JavaScriptCore/runtime/ArrayPrototype.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeCommonIdentifiersh">trunk/Source/JavaScriptCore/runtime/CommonIdentifiers.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSGenericTypedArrayViewh">trunk/Source/JavaScriptCore/runtime/JSGenericTypedArrayView.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSGenericTypedArrayViewInlinesh">trunk/Source/JavaScriptCore/runtime/JSGenericTypedArrayViewInlines.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSGenericTypedArrayViewPrototypeInlinesh">trunk/Source/JavaScriptCore/runtime/JSGenericTypedArrayViewPrototypeInlines.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSGlobalObjectcpp">trunk/Source/JavaScriptCore/runtime/JSGlobalObject.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSObjecth">trunk/Source/JavaScriptCore/runtime/JSObject.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSTypedArrayPrototypescpp">trunk/Source/JavaScriptCore/runtime/JSTypedArrayPrototypes.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSTypedArrayPrototypesh">trunk/Source/JavaScriptCore/runtime/JSTypedArrayPrototypes.h</a></li>
<li><a href="#trunkSourceJavaScriptCoretestses6yaml">trunk/Source/JavaScriptCore/tests/es6.yaml</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceJavaScriptCorebuiltinsTypedArrayprototypejs">trunk/Source/JavaScriptCore/builtins/TypedArray.prototype.js</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSGenericTypedArrayViewPrototypeFunctionsh">trunk/Source/JavaScriptCore/runtime/JSGenericTypedArrayViewPrototypeFunctions.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSTypedArrayViewPrototypecpp">trunk/Source/JavaScriptCore/runtime/JSTypedArrayViewPrototype.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSTypedArrayViewPrototypeh">trunk/Source/JavaScriptCore/runtime/JSTypedArrayViewPrototype.h</a></li>
<li>trunk/Source/JavaScriptCore/tests/stress/resources/</li>
<li><a href="#trunkSourceJavaScriptCoretestsstressresourcesstandaloneprejs">trunk/Source/JavaScriptCore/tests/stress/resources/standalone-pre.js</a></li>
<li><a href="#trunkSourceJavaScriptCoretestsstressresourcestypedarraytesthelperfunctionsjs">trunk/Source/JavaScriptCore/tests/stress/resources/typedarray-test-helper-functions.js</a></li>
<li><a href="#trunkSourceJavaScriptCoretestsstresstypedarraycopyWithinjs">trunk/Source/JavaScriptCore/tests/stress/typedarray-copyWithin.js</a></li>
<li><a href="#trunkSourceJavaScriptCoretestsstresstypedarrayeveryjs">trunk/Source/JavaScriptCore/tests/stress/typedarray-every.js</a></li>
<li><a href="#trunkSourceJavaScriptCoretestsstresstypedarrayfilljs">trunk/Source/JavaScriptCore/tests/stress/typedarray-fill.js</a></li>
<li><a href="#trunkSourceJavaScriptCoretestsstresstypedarrayfilterjs">trunk/Source/JavaScriptCore/tests/stress/typedarray-filter.js</a></li>
<li><a href="#trunkSourceJavaScriptCoretestsstresstypedarrayfindjs">trunk/Source/JavaScriptCore/tests/stress/typedarray-find.js</a></li>
<li><a href="#trunkSourceJavaScriptCoretestsstresstypedarrayfindIndexjs">trunk/Source/JavaScriptCore/tests/stress/typedarray-findIndex.js</a></li>
<li><a href="#trunkSourceJavaScriptCoretestsstresstypedarrayforEachjs">trunk/Source/JavaScriptCore/tests/stress/typedarray-forEach.js</a></li>
<li><a href="#trunkSourceJavaScriptCoretestsstresstypedarrayindexOfjs">trunk/Source/JavaScriptCore/tests/stress/typedarray-indexOf.js</a></li>
<li><a href="#trunkSourceJavaScriptCoretestsstresstypedarraylastIndexOfjs">trunk/Source/JavaScriptCore/tests/stress/typedarray-lastIndexOf.js</a></li>
<li><a href="#trunkSourceJavaScriptCoretestsstresstypedarraymapjs">trunk/Source/JavaScriptCore/tests/stress/typedarray-map.js</a></li>
<li><a href="#trunkSourceJavaScriptCoretestsstresstypedarrayreducejs">trunk/Source/JavaScriptCore/tests/stress/typedarray-reduce.js</a></li>
<li><a href="#trunkSourceJavaScriptCoretestsstresstypedarrayreduceRightjs">trunk/Source/JavaScriptCore/tests/stress/typedarray-reduceRight.js</a></li>
<li><a href="#trunkSourceJavaScriptCoretestsstresstypedarrayslicejs">trunk/Source/JavaScriptCore/tests/stress/typedarray-slice.js</a></li>
<li><a href="#trunkSourceJavaScriptCoretestsstresstypedarraysomejs">trunk/Source/JavaScriptCore/tests/stress/typedarray-some.js</a></li>
<li><a href="#trunkSourceJavaScriptCoretestsstresstypedarraysortjs">trunk/Source/JavaScriptCore/tests/stress/typedarray-sort.js</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (190366 => 190367)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2015-09-30 20:05:17 UTC (rev 190366)
+++ trunk/LayoutTests/ChangeLog        2015-09-30 21:00:42 UTC (rev 190367)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2015-09-30  Keith Miller  &lt;keith_miller@apple.com&gt;
+
+        [ES6] Add TypedArray.prototype functionality.
+        https://bugs.webkit.org/show_bug.cgi?id=148035
+
+        Reviewed by Geoffrey Garen.
+
+        Fixed tests for new toString behavior on TypedArrays.
+
+        * fast/canvas/webgl/type-conversion-test-expected.txt:
+        * fast/dom/Window/window-postmessage-clone-expected.txt:
+
</ins><span class="cx"> 2015-09-30  Timothy Horton  &lt;timothy_horton@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Compute document marker rects at use time instead of paint time
</span></span></pre></div>
<a id="trunkLayoutTestsfastcanvaswebgltypeconversiontestexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/canvas/webgl/type-conversion-test-expected.txt (190366 => 190367)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/canvas/webgl/type-conversion-test-expected.txt        2015-09-30 20:05:17 UTC (rev 190366)
+++ trunk/LayoutTests/fast/canvas/webgl/type-conversion-test-expected.txt        2015-09-30 21:00:42 UTC (rev 190367)
</span><span class="lines">@@ -765,7 +765,7 @@
</span><span class="cx"> PASS context.uniform4f(loc, 0, 0, argument, 0) is undefined.
</span><span class="cx"> PASS context.uniform4f(loc, 0, 0, 0, argument) is undefined.
</span><span class="cx"> 
</span><del>-testing type of TypedArray : value = [object Float32Array]
</del><ins>+testing type of TypedArray : value = 0
</ins><span class="cx"> PASS context.bindAttribLocation(program, argument, 'foo') is undefined.
</span><span class="cx"> PASS context.blendColor(argument, argument, argument, argument) is undefined.
</span><span class="cx"> PASS context.bufferData(context.ARRAY_BUFFER, argument, context.STATIC_DRAW) is undefined.
</span></span></pre></div>
<a id="trunkLayoutTestsfastdomWindowwindowpostmessagecloneexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/dom/Window/window-postmessage-clone-expected.txt (190366 => 190367)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/Window/window-postmessage-clone-expected.txt        2015-09-30 20:05:17 UTC (rev 190366)
+++ trunk/LayoutTests/fast/dom/Window/window-postmessage-clone-expected.txt        2015-09-30 21:00:42 UTC (rev 190367)
</span><span class="lines">@@ -46,9 +46,9 @@
</span><span class="cx"> LOG: [object Set] =&gt; true
</span><span class="cx"> LOG: [object Map] =&gt; [object Object]
</span><span class="cx"> PASS: eventData is [object ImageData] of type object
</span><del>-PASS: eventData is [object Uint8ClampedArray] of type object
</del><ins>+PASS: eventData is 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,1
 8,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143 of type object
</ins><span class="cx"> PASS: eventData is [object ImageData] of type object
</span><del>-PASS: eventData is [object Uint8ClampedArray] of type object
</del><ins>+PASS: eventData is 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,1
 8,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143 of type object
</ins><span class="cx"> PASS: eventData is 42 of type number
</span><span class="cx"> PASS: eventData is 42 of type number
</span><span class="cx"> PASS: evalThunk OK
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/CMakeLists.txt (190366 => 190367)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/CMakeLists.txt        2015-09-30 20:05:17 UTC (rev 190366)
+++ trunk/Source/JavaScriptCore/CMakeLists.txt        2015-09-30 21:00:42 UTC (rev 190367)
</span><span class="lines">@@ -574,6 +574,7 @@
</span><span class="cx">     runtime/JSTemplateRegistryKey.cpp
</span><span class="cx">     runtime/JSTypedArrayConstructors.cpp
</span><span class="cx">     runtime/JSTypedArrayPrototypes.cpp
</span><ins>+    runtime/JSTypedArrayViewPrototype.cpp
</ins><span class="cx">     runtime/JSTypedArrays.cpp
</span><span class="cx">     runtime/JSWeakMap.cpp
</span><span class="cx">     runtime/JSWeakSet.cpp
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (190366 => 190367)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog        2015-09-30 20:05:17 UTC (rev 190366)
+++ trunk/Source/JavaScriptCore/ChangeLog        2015-09-30 21:00:42 UTC (rev 190367)
</span><span class="lines">@@ -1,3 +1,199 @@
</span><ins>+2015-09-30  Keith Miller  &lt;keith_miller@apple.com&gt;
+
+        [ES6] Add TypedArray.prototype functionality.
+        https://bugs.webkit.org/show_bug.cgi?id=148035
+
+        Reviewed by Geoffrey Garen.
+
+        This patch should add most of the functionality for
+        the prototype properties of TypedArray objects in ES6.
+        There are a few exceptions to this, which will be added
+        in upcoming patches:
+
+        1) First we do not use the species constructor for some
+        of the TypedArray prototype functions (namely: map, filter,
+        slice, and subarray). That will need to be added when
+        species constructors are finished.
+
+        2) TypedArrays still have a length, byteOffset, byteLength,
+        and buffer are still attached to the TypedArray instance (in
+        the spec they are on the TypedArray.prototype instance object)
+        since the JIT currently assumes those properties are fixed.
+
+        3) The TypedArray.constructor property is not added yet
+        as it should point to the TypedArray instance object,
+        which will be added in a future patch.
+
+        * CMakeLists.txt:
+        * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
+        * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters:
+        * JavaScriptCore.xcodeproj/project.pbxproj:
+        * builtins/TypedArray.prototype.js: Added.
+        (every):
+        (find):
+        (findIndex):
+        (forEach):
+        (some):
+        (sort.min):
+        (sort.merge):
+        (sort.mergeSort):
+        (sort):
+        (reduce):
+        (reduceRight):
+        (map):
+        (filter):
+        (toLocaleString):
+        * runtime/ArrayPrototype.cpp:
+        * runtime/ArrayPrototype.h:
+        * runtime/CommonIdentifiers.h:
+        * runtime/JSGenericTypedArrayView.h:
+        (JSC::JSGenericTypedArrayView::toAdaptorNativeFromValue):
+        (JSC::JSGenericTypedArrayView::setRangeToValue):
+        (JSC::JSGenericTypedArrayView::sort):
+        (JSC::JSGenericTypedArrayView::purifyArray):
+        (JSC::JSGenericTypedArrayView::sortComparison):
+        (JSC::JSGenericTypedArrayView::sortFloat):
+        * runtime/JSGenericTypedArrayViewInlines.h:
+        * runtime/JSGenericTypedArrayViewPrototypeFunctions.h: Added.
+        (JSC::argumentClampedIndexFromStartOrEnd):
+        (JSC::genericTypedArrayViewProtoFuncSet):
+        (JSC::genericTypedArrayViewProtoFuncEntries):
+        (JSC::genericTypedArrayViewProtoFuncCopyWithin):
+        (JSC::genericTypedArrayViewProtoFuncFill):
+        (JSC::genericTypedArrayViewProtoFuncIndexOf):
+        (JSC::genericTypedArrayViewProtoFuncJoin):
+        (JSC::genericTypedArrayViewProtoFuncKeys):
+        (JSC::genericTypedArrayViewProtoFuncLastIndexOf):
+        (JSC::genericTypedArrayViewProtoGetterFuncLength):
+        (JSC::genericTypedArrayViewProtoGetterFuncByteLength):
+        (JSC::genericTypedArrayViewProtoGetterFuncByteOffset):
+        (JSC::genericTypedArrayViewProtoFuncReverse):
+        (JSC::genericTypedArrayViewPrivateFuncSort):
+        (JSC::genericTypedArrayViewProtoFuncSlice):
+        (JSC::genericTypedArrayViewProtoFuncSubarray):
+        (JSC::typedArrayViewProtoFuncValues):
+        * runtime/JSGenericTypedArrayViewPrototypeInlines.h:
+        (JSC::JSGenericTypedArrayViewPrototype&lt;ViewClass&gt;::finishCreation):
+        (JSC::genericTypedArrayViewProtoFuncSet): Deleted.
+        (JSC::genericTypedArrayViewProtoFuncSubarray): Deleted.
+        * runtime/JSGlobalObject.cpp:
+        (JSC::JSGlobalObject::init):
+        * runtime/JSObject.h:
+        * runtime/JSTypedArrayPrototypes.cpp:
+        * runtime/JSTypedArrayPrototypes.h:
+        * runtime/JSTypedArrayViewPrototype.cpp: Added.
+        (JSC::typedArrayViewPrivateFuncLength):
+        (JSC::typedArrayViewPrivateFuncSort):
+        (JSC::typedArrayViewProtoFuncSet):
+        (JSC::typedArrayViewProtoFuncEntries):
+        (JSC::typedArrayViewProtoFuncCopyWithin):
+        (JSC::typedArrayViewProtoFuncFill):
+        (JSC::typedArrayViewProtoFuncLastIndexOf):
+        (JSC::typedArrayViewProtoFuncIndexOf):
+        (JSC::typedArrayViewProtoFuncJoin):
+        (JSC::typedArrayViewProtoFuncKeys):
+        (JSC::typedArrayViewProtoGetterFuncLength):
+        (JSC::typedArrayViewProtoGetterFuncByteLength):
+        (JSC::typedArrayViewProtoGetterFuncByteOffset):
+        (JSC::typedArrayViewProtoFuncReverse):
+        (JSC::typedArrayViewProtoFuncSubarray):
+        (JSC::typedArrayViewProtoFuncSlice):
+        (JSC::typedArrayViewProtoFuncValues):
+        (JSC::JSTypedArrayViewPrototype::JSTypedArrayViewPrototype):
+        (JSC::JSTypedArrayViewPrototype::finishCreation):
+        (JSC::JSTypedArrayViewPrototype::create):
+        (JSC::JSTypedArrayViewPrototype::createStructure):
+        * runtime/JSTypedArrayViewPrototype.h: Copied from Source/JavaScriptCore/runtime/JSTypedArrayPrototypes.cpp.
+        * tests/stress/resources/standalone-pre.js: Added.
+        (description):
+        (debug):
+        (escapeString):
+        (testPassed):
+        (testFailed):
+        (areNumbersEqual):
+        (areArraysEqual):
+        (isMinusZero):
+        (isTypedArray):
+        (isResultCorrect):
+        (stringify):
+        (shouldBe):
+        (dfgShouldBe):
+        (shouldBeType):
+        (shouldBeTrue):
+        (shouldBeFalse):
+        (shouldBeNaN):
+        (shouldBeNull):
+        (shouldBeEqualToString):
+        (shouldBeUndefined):
+        (shouldNotThrow):
+        (shouldThrow):
+        (dfgCompiled):
+        (dfgIncrement):
+        (noInline):
+        (finishJSTest):
+        * tests/stress/resources/typedarray-test-helper-functions.js: Added.
+        (forEachTypedArray):
+        (isSameFunctionForEachTypedArrayPrototype.eq):
+        (isSameFunctionForEachTypedArrayPrototype):
+        (hasSameValues):
+        (.foo):
+        (testPrototypeFunctionHelper):
+        (testPrototypeFunctionOnSigned):
+        (testPrototypeFunctionOnFloat):
+        (testPrototypeFunction):
+        (.tester):
+        (testPrototypeReceivesArray):
+        * tests/stress/typedarray-copyWithin.js: Added.
+        * tests/stress/typedarray-every.js: Added.
+        (isBigEnough):
+        (isBigEnoughAndChange):
+        (isBigEnoughAndException):
+        * tests/stress/typedarray-fill.js: Added.
+        * tests/stress/typedarray-filter.js: Added.
+        (keepEven):
+        (keepEvenAndChange):
+        (isBigEnoughAndException):
+        * tests/stress/typedarray-find.js: Added.
+        (keepEven):
+        (keepEvenAndChange):
+        (isBigEnoughAndException):
+        * tests/stress/typedarray-findIndex.js: Added.
+        (keepEven):
+        (keepEvenAndChange):
+        (isBigEnoughAndException):
+        * tests/stress/typedarray-forEach.js: Added.
+        (.checkCorrect.let.list):
+        (.checkCorrect):
+        (createChecker):
+        (foo):
+        (changeArray):
+        (isBigEnoughAndException):
+        * tests/stress/typedarray-indexOf.js: Added.
+        (keepEven):
+        * tests/stress/typedarray-lastIndexOf.js: Added.
+        * tests/stress/typedarray-map.js: Added.
+        (even):
+        (evenAndChange):
+        (isBigEnoughAndException):
+        * tests/stress/typedarray-reduce.js: Added.
+        (createArray):
+        (sum):
+        (createArrayAndChange):
+        (isBigEnoughAndException):
+        * tests/stress/typedarray-reduceRight.js: Added.
+        (createArray):
+        (sum):
+        (createArrayAndChange):
+        (isBigEnoughAndException):
+        * tests/stress/typedarray-slice.js: Added.
+        * tests/stress/typedarray-some.js: Added.
+        (isBigEnough):
+        (isBigEnoughAndChange):
+        (isBigEnoughAndException):
+        * tests/stress/typedarray-sort.js: Added.
+        (sortBackwards):
+        (compareException):
+
</ins><span class="cx"> 2015-09-30  Commit Queue  &lt;commit-queue@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Unreviewed, rolling out r190324.
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreJavaScriptCorevcxprojJavaScriptCorevcxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj (190366 => 190367)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj        2015-09-30 20:05:17 UTC (rev 190366)
+++ trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj        2015-09-30 21:00:42 UTC (rev 190367)
</span><span class="lines">@@ -823,6 +823,7 @@
</span><span class="cx">     &lt;ClCompile Include=&quot;..\runtime\JSTypedArrayConstructors.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\runtime\JSTypedArrayPrototypes.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\runtime\JSTypedArrays.cpp&quot; /&gt;
</span><ins>+    &lt;ClCompile Include=&quot;..\runtime\JSTypedArrayViewPrototype.cpp&quot; /&gt;
</ins><span class="cx">     &lt;ClCompile Include=&quot;..\runtime\JSEnvironmentRecord.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\runtime\JSWeakMap.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\runtime\JSWeakSet.cpp&quot; /&gt;
</span><span class="lines">@@ -1649,6 +1650,7 @@
</span><span class="cx">     &lt;ClInclude Include=&quot;..\runtime\JSGenericTypedArrayViewConstructorInlines.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\runtime\JSGenericTypedArrayViewInlines.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\runtime\JSGenericTypedArrayViewPrototype.h&quot; /&gt;
</span><ins>+    &lt;ClInclude Include=&quot;..\runtime\JSGenericTypedArrayViewPrototypeFunctions.h&quot; /&gt;
</ins><span class="cx">     &lt;ClInclude Include=&quot;..\runtime\JSGenericTypedArrayViewPrototypeInlines.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\runtime\JSGlobalObject.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\runtime\JSGlobalObjectFunctions.h&quot; /&gt;
</span><span class="lines">@@ -1693,6 +1695,7 @@
</span><span class="cx">     &lt;ClInclude Include=&quot;..\runtime\JSTypedArrayConstructors.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\runtime\JSTypedArrayPrototypes.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\runtime\JSTypedArrays.h&quot; /&gt;
</span><ins>+    &lt;ClInclude Include=&quot;..\runtime\JSTypedArrayViewPrototype.h&quot; /&gt;
</ins><span class="cx">     &lt;ClInclude Include=&quot;..\runtime\JSUint16Array.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\runtime\JSUint32Array.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\runtime\JSUint8Array.h&quot; /&gt;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreJavaScriptCorevcxprojJavaScriptCorevcxprojfilters"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters (190366 => 190367)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters        2015-09-30 20:05:17 UTC (rev 190366)
+++ trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters        2015-09-30 21:00:42 UTC (rev 190367)
</span><span class="lines">@@ -1083,6 +1083,9 @@
</span><span class="cx">     &lt;ClCompile Include=&quot;..\runtime\JSTypedArrays.cpp&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;runtime&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClCompile&gt;
</span><ins>+    &lt;ClCompile Include=&quot;..\runtime\JSTypedArrayViewPrototype.cpp&quot;&gt;
+      &lt;Filter&gt;runtime&lt;/Filter&gt;
+    &lt;/ClCompile&gt;
</ins><span class="cx">     &lt;ClCompile Include=&quot;..\runtime\DataView.cpp&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;runtime&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClCompile&gt;
</span><span class="lines">@@ -3375,6 +3378,9 @@
</span><span class="cx">     &lt;ClInclude Include=&quot;..\runtime\JSGenericTypedArrayViewPrototype.h&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;runtime&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClInclude&gt;
</span><ins>+    &lt;ClInclude Include=&quot;..\runtime\JSGenericTypedArrayViewPrototypeFunctions.h&quot;&gt;
+      &lt;Filter&gt;runtime&lt;/Filter&gt;
+    &lt;/ClInclude&gt;
</ins><span class="cx">     &lt;ClInclude Include=&quot;..\runtime\JSInternalPromise.h&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;runtime&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClInclude&gt;
</span><span class="lines">@@ -3450,6 +3456,9 @@
</span><span class="cx">     &lt;ClInclude Include=&quot;..\runtime\JSTypedArrays.h&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;runtime&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClInclude&gt;
</span><ins>+    &lt;ClInclude Include=&quot;..\runtime\JSTypedArrayViewPrototype.h&quot;&gt;
+      &lt;Filter&gt;runtime&lt;/Filter&gt;
+    &lt;/ClCompile&gt;
</ins><span class="cx">     &lt;ClInclude Include=&quot;..\runtime\JSUint16Array.h&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;runtime&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClInclude&gt;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreJavaScriptCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj (190366 => 190367)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj        2015-09-30 20:05:17 UTC (rev 190366)
+++ trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj        2015-09-30 21:00:42 UTC (rev 190367)
</span><span class="lines">@@ -971,6 +971,7 @@
</span><span class="cx">                 52C0611F1AA51E1C00B4ADBA /* RuntimeType.h in Headers */ = {isa = PBXBuildFile; fileRef = 52C0611D1AA51E1B00B4ADBA /* RuntimeType.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 52C952B719A289850069B386 /* TypeProfiler.h in Headers */ = {isa = PBXBuildFile; fileRef = 52C952B619A289850069B386 /* TypeProfiler.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 52C952B919A28A1C0069B386 /* TypeProfiler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 52C952B819A28A1C0069B386 /* TypeProfiler.cpp */; };
</span><ins>+                53917E7B1B7906FA000EBD33 /* JSGenericTypedArrayViewPrototypeFunctions.h in Headers */ = {isa = PBXBuildFile; fileRef = 53917E7A1B7906E4000EBD33 /* JSGenericTypedArrayViewPrototypeFunctions.h */; };
</ins><span class="cx">                 5D53726F0E1C54880021E549 /* Tracing.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D53726E0E1C54880021E549 /* Tracing.h */; };
</span><span class="cx">                 5D5D8AD10E0D0EBE00F9C692 /* libedit.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 5D5D8AD00E0D0EBE00F9C692 /* libedit.dylib */; };
</span><span class="cx">                 5DBB151B131D0B310056AD36 /* testapi.js in Copy Support Script */ = {isa = PBXBuildFile; fileRef = 14D857740A4696C80032146C /* testapi.js */; };
</span><span class="lines">@@ -1714,6 +1715,8 @@
</span><span class="cx">                 C4F4B6F51A05C984005CAB76 /* generate_objc_protocol_types_implementation.py in Headers */ = {isa = PBXBuildFile; fileRef = C4F4B6D71A05C76F005CAB76 /* generate_objc_protocol_types_implementation.py */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 C4F4B6F61A05C984005CAB76 /* objc_generator_templates.py in Headers */ = {isa = PBXBuildFile; fileRef = C4F4B6D81A05C76F005CAB76 /* objc_generator_templates.py */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 DC00039319D8BE6F00023EB0 /* DFGPreciseLocalClobberize.h in Headers */ = {isa = PBXBuildFile; fileRef = DC00039019D8BE6F00023EB0 /* DFGPreciseLocalClobberize.h */; };
</span><ins>+                DEA7E2441BBC677200D78440 /* JSTypedArrayViewPrototype.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 53F256E11B87E28000B4B768 /* JSTypedArrayViewPrototype.cpp */; };
+                DEA7E2451BBC677F00D78440 /* JSTypedArrayViewPrototype.h in Headers */ = {isa = PBXBuildFile; fileRef = 53917E7C1B791106000EBD33 /* JSTypedArrayViewPrototype.h */; settings = {ATTRIBUTES = (Private, ); }; };
</ins><span class="cx">                 E124A8F70E555775003091F1 /* OpaqueJSString.h in Headers */ = {isa = PBXBuildFile; fileRef = E124A8F50E555775003091F1 /* OpaqueJSString.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 E124A8F80E555775003091F1 /* OpaqueJSString.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E124A8F60E555775003091F1 /* OpaqueJSString.cpp */; };
</span><span class="cx">                 E18E3A590DF9278C00D90B34 /* VM.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E18E3A570DF9278C00D90B34 /* VM.cpp */; };
</span><span class="lines">@@ -2785,6 +2788,10 @@
</span><span class="cx">                 52C0611D1AA51E1B00B4ADBA /* RuntimeType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RuntimeType.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 52C952B619A289850069B386 /* TypeProfiler.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TypeProfiler.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 52C952B819A28A1C0069B386 /* TypeProfiler.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = TypeProfiler.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                53917E7A1B7906E4000EBD33 /* JSGenericTypedArrayViewPrototypeFunctions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSGenericTypedArrayViewPrototypeFunctions.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                53917E7C1B791106000EBD33 /* JSTypedArrayViewPrototype.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSTypedArrayViewPrototype.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                53917E831B791CB8000EBD33 /* TypedArray.prototype.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = TypedArray.prototype.js; path = builtins/TypedArray.prototype.js; sourceTree = SOURCE_ROOT; };
+                53F256E11B87E28000B4B768 /* JSTypedArrayViewPrototype.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSTypedArrayViewPrototype.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 5540758418F4A37500602A5D /* CompileRuntimeToLLVMIR.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = CompileRuntimeToLLVMIR.xcconfig; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 593D43CCA0BBE06D89C59707 /* MapDataInlines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MapDataInlines.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 5D53726D0E1C546B0021E549 /* Tracing.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Tracing.d; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -4806,6 +4813,7 @@
</span><span class="cx">                                 0F2B66C517B6B5AB00A7AE3F /* JSGenericTypedArrayViewConstructorInlines.h */,
</span><span class="cx">                                 0F2B66C617B6B5AB00A7AE3F /* JSGenericTypedArrayViewInlines.h */,
</span><span class="cx">                                 0F2B66C717B6B5AB00A7AE3F /* JSGenericTypedArrayViewPrototype.h */,
</span><ins>+                                53917E7A1B7906E4000EBD33 /* JSGenericTypedArrayViewPrototypeFunctions.h */,
</ins><span class="cx">                                 0F2B66C817B6B5AB00A7AE3F /* JSGenericTypedArrayViewPrototypeInlines.h */,
</span><span class="cx">                                 797E07A71B8FCFB9008400BA /* JSGlobalLexicalEnvironment.cpp */,
</span><span class="cx">                                 797E07A81B8FCFB9008400BA /* JSGlobalLexicalEnvironment.h */,
</span><span class="lines">@@ -4890,6 +4898,8 @@
</span><span class="cx">                                 0F2B66CF17B6B5AB00A7AE3F /* JSTypedArrayPrototypes.h */,
</span><span class="cx">                                 0F2B66D017B6B5AB00A7AE3F /* JSTypedArrays.cpp */,
</span><span class="cx">                                 0F2B66D117B6B5AB00A7AE3F /* JSTypedArrays.h */,
</span><ins>+                                53F256E11B87E28000B4B768 /* JSTypedArrayViewPrototype.cpp */,
+                                53917E7C1B791106000EBD33 /* JSTypedArrayViewPrototype.h */,
</ins><span class="cx">                                 6507D2970E871E4A00D7D896 /* JSTypeInfo.h */,
</span><span class="cx">                                 0F2B66D417B6B5AB00A7AE3F /* JSUint16Array.h */,
</span><span class="cx">                                 0F2B66D517B6B5AB00A7AE3F /* JSUint32Array.h */,
</span><span class="lines">@@ -5885,6 +5895,7 @@
</span><span class="cx">                                 7CF9BC5F1B65D9B1009DB1EF /* ReflectObject.js */,
</span><span class="cx">                                 7CF9BC601B65D9B1009DB1EF /* StringConstructor.js */,
</span><span class="cx">                                 7CF9BC611B65D9B1009DB1EF /* StringIterator.prototype.js */,
</span><ins>+                                53917E831B791CB8000EBD33 /* TypedArray.prototype.js */,
</ins><span class="cx">                         );
</span><span class="cx">                         path = builtins;
</span><span class="cx">                         sourceTree = &quot;&lt;group&gt;&quot;;
</span><span class="lines">@@ -6221,6 +6232,7 @@
</span><span class="cx">                                 0FB17663196B8F9E0091052A /* DFGPureValue.h in Headers */,
</span><span class="cx">                                 0F3A1BFA1A9ECB7D000DE01A /* DFGPutStackSinkingPhase.h in Headers */,
</span><span class="cx">                                 86EC9DD11328DF82002B2AD7 /* DFGRegisterBank.h in Headers */,
</span><ins>+                                DEA7E2451BBC677F00D78440 /* JSTypedArrayViewPrototype.h in Headers */,
</ins><span class="cx">                                 0F2FCCFC18A60070001A27F8 /* DFGSafepoint.h in Headers */,
</span><span class="cx">                                 A77A424317A0BBFD00A8DB81 /* DFGSafeToExecute.h in Headers */,
</span><span class="cx">                                 A741017F179DAF80002EB8BA /* DFGSaneStringGetByValSlowPathGenerator.h in Headers */,
</span><span class="lines">@@ -6360,7 +6372,6 @@
</span><span class="cx">                                 2AABCDE718EF294200002096 /* GCLogging.h in Headers */,
</span><span class="cx">                                 A54E8EB018BFFBBB00556D28 /* GCSegmentedArray.h in Headers */,
</span><span class="cx">                                 A54E8EB118BFFBBE00556D28 /* GCSegmentedArrayInlines.h in Headers */,
</span><del>-                                C2239D1B16262BDD005AC5FD /* GCThread.h in Headers */,
</del><span class="cx">                                 A532439418569709002ED692 /* generate-combined-inspector-json.py in Headers */,
</span><span class="cx">                                 C4703CC0192844960013FBEA /* generate-inspector-protocol-bindings.py in Headers */,
</span><span class="cx">                                 2DFB8AFE1BB323BD0093D237 /* generate-js-builtins in Headers */,
</span><span class="lines">@@ -6543,6 +6554,7 @@
</span><span class="cx">                                 86E3C614167BABD7006D760A /* JSExport.h in Headers */,
</span><span class="cx">                                 A7B4ACAF1484C9CE00B38A36 /* JSExportMacros.h in Headers */,
</span><span class="cx">                                 0F2B66EF17B6B5AB00A7AE3F /* JSFloat32Array.h in Headers */,
</span><ins>+                                53917E7B1B7906FA000EBD33 /* JSGenericTypedArrayViewPrototypeFunctions.h in Headers */,
</ins><span class="cx">                                 0F2B66F017B6B5AB00A7AE3F /* JSFloat64Array.h in Headers */,
</span><span class="cx">                                 BC18C41F0E16F5CD00B34460 /* JSFunction.h in Headers */,
</span><span class="cx">                                 A72028BA1797603D0098028C /* JSFunctionInlines.h in Headers */,
</span><span class="lines">@@ -7717,7 +7729,6 @@
</span><span class="cx">                                 2AACE63C18CA5A0300ED0191 /* GCActivityCallback.cpp in Sources */,
</span><span class="cx">                                 0F766D2F15A8DCE0008F363E /* GCAwareJITStubRoutine.cpp in Sources */,
</span><span class="cx">                                 2ADFA26318EF3540004F9FCC /* GCLogging.cpp in Sources */,
</span><del>-                                C2239D1A16262BDD005AC5FD /* GCThread.cpp in Sources */,
</del><span class="cx">                                 0F93329F14CA7DCA0085F3C6 /* GetByIdStatus.cpp in Sources */,
</span><span class="cx">                                 0F0332C318B01763005F979A /* GetByIdVariant.cpp in Sources */,
</span><span class="cx">                                 14280855107EC0E70013E7B2 /* GetterSetter.cpp in Sources */,
</span><span class="lines">@@ -7953,6 +7964,7 @@
</span><span class="cx">                                 0F98206016BFE38100240D02 /* PreciseJumpTargets.cpp in Sources */,
</span><span class="cx">                                 95742F650DD11F5A000917FB /* Profile.cpp in Sources */,
</span><span class="cx">                                 95CD45760E1C4FDD0085358E /* ProfileGenerator.cpp in Sources */,
</span><ins>+                                DEA7E2441BBC677200D78440 /* JSTypedArrayViewPrototype.cpp in Sources */,
</ins><span class="cx">                                 95AB83560DA43C3000BC83F3 /* ProfileNode.cpp in Sources */,
</span><span class="cx">                                 0FF729AD166AD35C000F5BA3 /* ProfilerBytecode.cpp in Sources */,
</span><span class="cx">                                 0FF729AE166AD35C000F5BA3 /* ProfilerBytecodes.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebuiltinsTypedArrayprototypejs"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/builtins/TypedArray.prototype.js (0 => 190367)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/builtins/TypedArray.prototype.js                                (rev 0)
+++ trunk/Source/JavaScriptCore/builtins/TypedArray.prototype.js        2015-09-30 21:00:42 UTC (rev 190367)
</span><span class="lines">@@ -0,0 +1,287 @@
</span><ins>+/*
+ * Copyright (C) 2015 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// Note that the intrisic @typedArrayLength checks the that the argument passed is a typed array
+// and throws if it is not.
+
+function every(callback /*, thisArg */)
+{
+    &quot;use strict&quot;;
+    var length = @typedArrayLength(this);
+    var thisArg = arguments.length &gt; 1 ? arguments[1] : undefined;
+
+    if (typeof callback !== &quot;function&quot;)
+        throw new @TypeError(&quot;TypedArray.prototype.every callback must be a function&quot;);
+
+    for (var i = 0; i &lt; length; i++) {
+        if (!callback.@call(thisArg, this[i], i, this))
+            return false;
+    }
+
+    return true;
+}
+
+function find(callback /* [, thisArg] */)
+{
+    &quot;use strict&quot;;
+    var length = @typedArrayLength(this);
+    var thisArg = arguments.length &gt; 1 ? arguments[1] : undefined;
+
+    if (typeof callback !== &quot;function&quot;)
+        throw new @TypeError(&quot;TypedArray.prototype.find callback must be a function&quot;);
+
+    for (var i = 0; i &lt; length; i++) {
+        let elem = this[i];
+        if (callback.@call(thisArg, elem, i, this))
+            return elem;
+    }
+    return undefined;
+}
+
+function findIndex(callback /* [, thisArg] */)
+{
+    &quot;use strict&quot;;
+    var length = @typedArrayLength(this);
+    var thisArg = arguments.length &gt; 1 ? arguments[1] : undefined;
+
+    if (typeof callback !== &quot;function&quot;)
+        throw new @TypeError(&quot;TypedArray.prototype.findIndex callback must be a function&quot;);
+
+    for (var i = 0; i &lt; length; i++) {
+        if (callback.@call(thisArg, this[i], i, this))
+            return i;
+    }
+    return -1;
+}
+
+function forEach(callback /* [, thisArg] */)
+{
+    &quot;use strict&quot;;
+    var length = @typedArrayLength(this);
+    var thisArg = arguments.length &gt; 1 ? arguments[1] : undefined;
+
+    if (typeof callback !== &quot;function&quot;)
+        throw new @TypeError(&quot;TypedArray.prototype.findIndex callback must be a function&quot;);
+
+    for (var i = 0; i &lt; length; i++)
+        callback.@call(thisArg, this[i], i, this);
+}
+
+function some(callback /* [, thisArg] */)
+{
+    // 22.2.3.24
+    &quot;use strict&quot;;
+    var length = @typedArrayLength(this);
+    var thisArg = arguments.length &gt; 1 ? arguments[1] : undefined;
+
+    if (typeof callback !== &quot;function&quot;)
+        throw new @TypeError(&quot;TypedArray.prototype.some callback must be a function&quot;);
+
+    for (var i = 0; i &lt; length; i++) {
+        if (callback.@call(thisArg, this[i], i, this))
+            return true;
+    }
+
+    return false;
+}
+
+function sort(comparator)
+{
+    // 22.2.3.25
+    &quot;use strict&quot;;
+
+    function min(a, b)
+    {
+        return a &lt; b ? a : b;
+    }
+
+    function merge(dst, src, srcIndex, srcEnd, width, comparator)
+    {
+        var left = srcIndex;
+        var leftEnd = min(left + width, srcEnd);
+        var right = leftEnd;
+        var rightEnd = min(right + width, srcEnd);
+
+        for (var dstIndex = left; dstIndex &lt; rightEnd; ++dstIndex) {
+            if (right &lt; rightEnd) {
+                if (left &gt;= leftEnd || comparator(src[right], src[left]) &lt; 0) {
+                    dst[dstIndex] = src[right++];
+                    continue;
+                }
+            }
+
+            dst[dstIndex] = src[left++];
+        }
+    }
+
+    function mergeSort(array, valueCount, comparator)
+    {
+        var buffer = [ ];
+        buffer.length = valueCount;
+
+        var dst = buffer;
+        var src = array;
+
+        for (var width = 1; width &lt; valueCount; width *= 2) {
+            for (var srcIndex = 0; srcIndex &lt; valueCount; srcIndex += 2 * width)
+                merge(dst, src, srcIndex, valueCount, width, comparator);
+
+            var tmp = src;
+            src = dst;
+            dst = tmp;
+        }
+
+        if (src != array) {
+            for(var i = 0; i &lt; valueCount; i++)
+                array[i] = src[i];
+        }
+    }
+
+    var length = @typedArrayLength(this);
+
+    if (length &lt; 2)
+        return;
+
+    if (typeof comparator == &quot;function&quot;)
+        mergeSort(this, length, comparator);
+    else
+        @typedArraySort(this);
+    
+    return this;
+}
+
+function reduce(callback /* [, initialValue] */)
+{
+    // 22.2.3.19
+    &quot;use strict&quot;;
+
+    var length = @typedArrayLength(this);
+
+    if (typeof callback !== &quot;function&quot;)
+        throw new @TypeError(&quot;TypedArray.prototype.reduce callback must be a function&quot;);
+
+    if (length === 0 &amp;&amp; arguments.length &lt; 2)
+        throw new @TypeError(&quot;TypedArray.prototype.reduce of empty array with no initial value&quot;);
+
+    var accumulator, k = 0;
+    if (arguments.length &gt; 1)
+        accumulator = arguments[1];
+    else
+        accumulator = this[k++];
+
+    for (; k &lt; length; k++)
+        accumulator = callback.@call(undefined, accumulator, this[k], k, this);
+
+    return accumulator;
+}
+
+function reduceRight(callback /* [, initialValue] */)
+{
+    // 22.2.3.20
+    &quot;use strict&quot;;
+
+    var length = @typedArrayLength(this);
+
+    if (typeof callback !== &quot;function&quot;)
+        throw new @TypeError(&quot;TypedArray.prototype.reduceRight callback must be a function&quot;);
+
+    if (length === 0 &amp;&amp; arguments.length &lt; 2)
+        throw new @TypeError(&quot;TypedArray.prototype.reduceRight of empty array with no initial value&quot;);
+
+    var accumulator, k = length - 1;
+    if (arguments.length &gt; 1)
+        accumulator = arguments[1];
+    else
+        accumulator = this[k--];
+
+    for (; k &gt;= 0; k--)
+        accumulator = callback.@call(undefined, accumulator, this[k], k, this);
+
+    return accumulator;
+}
+
+function map(callback /*, thisArg */)
+{
+    // 22.2.3.18
+    &quot;use strict&quot;;
+
+    var length = @typedArrayLength(this);
+
+    if (typeof callback !== &quot;function&quot;)
+        throw new @TypeError(&quot;TypedArray.prototype.map callback must be a function&quot;);
+
+    var thisArg = arguments.length &gt; 1 ? arguments[1] : undefined;
+    // FIXME: This should be a species constructor.
+    var result = new this.constructor(length);
+    for (var i = 0; i &lt; length; i++) {
+        var mappedValue = callback.@call(thisArg, this[i], i, this);
+        result[i] = mappedValue;
+    }
+    return result;
+}
+
+function filter(callback /*, thisArg */)
+{
+    &quot;use strict&quot;;
+
+    var length = @typedArrayLength(this);
+
+    if (typeof callback !== &quot;function&quot;)
+        throw new @TypeError(&quot;Array.prototype.map callback must be a function&quot;);
+
+    var thisArg = arguments.length &gt; 1 ? arguments[1] : undefined;
+
+    var kept = [];
+
+    for (var i = 0; i &lt; length; i++) {
+        var value = this[i];
+        if (callback.@call(thisArg, value, i, this))
+            kept.push(value);
+    }
+
+    // FIXME: This should be a species constructor.
+    var result = new this.constructor(kept.length);
+
+    for (var i = 0; i &lt; kept.length; i++)
+        result[i] = kept[i];
+
+    return result;
+}
+
+function toLocaleString()
+{
+    &quot;use strint&quot;;
+
+    var length = @typedArrayLength(this);
+
+    if (length == 0)
+        return &quot;&quot;;
+
+    var string = this[0].toLocaleString();
+    for (var i = 1; i &lt; length; i++)
+        string += &quot;,&quot; + this[i].toLocaleString();
+
+    return string;
+}
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeArrayPrototypecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/ArrayPrototype.cpp (190366 => 190367)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/ArrayPrototype.cpp        2015-09-30 20:05:17 UTC (rev 190366)
+++ trunk/Source/JavaScriptCore/runtime/ArrayPrototype.cpp        2015-09-30 21:00:42 UTC (rev 190367)
</span><span class="lines">@@ -46,7 +46,6 @@
</span><span class="cx"> 
</span><span class="cx"> namespace JSC {
</span><span class="cx"> 
</span><del>-EncodedJSValue JSC_HOST_CALL arrayProtoFuncToString(ExecState*);
</del><span class="cx"> EncodedJSValue JSC_HOST_CALL arrayProtoFuncToLocaleString(ExecState*);
</span><span class="cx"> EncodedJSValue JSC_HOST_CALL arrayProtoFuncConcat(ExecState*);
</span><span class="cx"> EncodedJSValue JSC_HOST_CALL arrayProtoFuncJoin(ExecState*);
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeArrayPrototypeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/ArrayPrototype.h (190366 => 190367)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/ArrayPrototype.h        2015-09-30 20:05:17 UTC (rev 190366)
+++ trunk/Source/JavaScriptCore/runtime/ArrayPrototype.h        2015-09-30 21:00:42 UTC (rev 190367)
</span><span class="lines">@@ -46,6 +46,7 @@
</span><span class="cx">     void finishCreation(VM&amp;, JSGlobalObject*);
</span><span class="cx"> };
</span><span class="cx"> 
</span><ins>+EncodedJSValue JSC_HOST_CALL arrayProtoFuncToString(ExecState*);
</ins><span class="cx"> EncodedJSValue JSC_HOST_CALL arrayProtoFuncValues(ExecState*);
</span><span class="cx"> 
</span><span class="cx"> } // namespace JSC
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeCommonIdentifiersh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/CommonIdentifiers.h (190366 => 190367)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/CommonIdentifiers.h        2015-09-30 20:05:17 UTC (rev 190366)
+++ trunk/Source/JavaScriptCore/runtime/CommonIdentifiers.h        2015-09-30 21:00:42 UTC (rev 190367)
</span><span class="lines">@@ -292,6 +292,8 @@
</span><span class="cx">     macro(getPrototypeOf) \
</span><span class="cx">     macro(getOwnPropertyNames) \
</span><span class="cx">     macro(TypeError) \
</span><ins>+    macro(typedArrayLength) \
+    macro(typedArraySort) \
</ins><span class="cx">     macro(undefined) \
</span><span class="cx">     macro(BuiltinLog) \
</span><span class="cx">     macro(homeObject) \
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSGenericTypedArrayViewh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSGenericTypedArrayView.h (190366 => 190367)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSGenericTypedArrayView.h        2015-09-30 20:05:17 UTC (rev 190366)
+++ trunk/Source/JavaScriptCore/runtime/JSGenericTypedArrayView.h        2015-09-30 21:00:42 UTC (rev 190367)
</span><span class="lines">@@ -87,6 +87,8 @@
</span><span class="cx"> class JSGenericTypedArrayView : public JSArrayBufferView {
</span><span class="cx"> public:
</span><span class="cx">     typedef JSArrayBufferView Base;
</span><ins>+    typedef typename Adaptor::Type ElementType;
+
</ins><span class="cx">     static const unsigned StructureFlags = Base::StructureFlags | OverridesGetPropertyNames | OverridesGetOwnPropertySlot | InterceptsGetOwnPropertySlotByIndexEvenWhenLengthIsNotZero;
</span><span class="cx"> 
</span><span class="cx">     static const unsigned elementSize = sizeof(typename Adaptor::Type);
</span><span class="lines">@@ -168,7 +170,48 @@
</span><span class="cx">         setIndexQuicklyToNativeValue(i, value);
</span><span class="cx">         return true;
</span><span class="cx">     }
</span><del>-    
</del><ins>+
+    static Optional&lt;typename Adaptor::Type&gt; toAdaptorNativeFromValue(ExecState* exec, JSValue jsValue)
+    {
+        typename Adaptor::Type value = toNativeFromValue&lt;Adaptor&gt;(exec, jsValue);
+        if (exec-&gt;hadException())
+            return Nullopt;
+        return value;
+    }
+
+    bool setRangeToValue(ExecState* exec, unsigned start, unsigned end, JSValue jsValue)
+    {
+        ASSERT(0 &lt;= start &amp;&amp; start &lt;= end &amp;&amp; end &lt;= m_length);
+
+        typename Adaptor::Type value = toNativeFromValue&lt;Adaptor&gt;(exec, jsValue);
+        if (exec-&gt;hadException())
+            return false;
+
+        // We might want to do something faster here (e.g. SIMD) if this is too slow.
+        typename Adaptor::Type* array = typedVector();
+        for (unsigned i = start; i &lt; end; ++i)
+            array[i] = value;
+
+        return true;
+    }
+
+    void sort()
+    {
+        switch (Adaptor::typeValue) {
+        case TypeFloat32:
+            sortFloat&lt;int32_t&gt;();
+            break;
+        case TypeFloat64:
+            sortFloat&lt;int64_t&gt;();
+            break;
+        default: {
+            ElementType* array = typedVector();
+            std::sort(array, array + m_length);
+            break;
+        }
+        }
+    }
+
</ins><span class="cx">     bool canAccessRangeQuickly(unsigned offset, unsigned length)
</span><span class="cx">     {
</span><span class="cx">         return offset &lt;= m_length
</span><span class="lines">@@ -257,6 +300,64 @@
</span><span class="cx">     bool setWithSpecificType(
</span><span class="cx">         ExecState*, JSGenericTypedArrayView&lt;OtherAdaptor&gt;*,
</span><span class="cx">         unsigned offset, unsigned length);
</span><ins>+
+    // The ECMA 6 spec states that floating point Typed Arrays should have the following ordering:
+    //
+    // -Inifinity &lt; negative finite numbers &lt; -0.0 &lt; 0.0 &lt; positive finite numbers &lt; Infinity &lt; NaN
+    // Note: regardless of the sign or exact representation of a NaN it is greater than all other values.
+    //
+    // An interesting fact about IEEE 754 floating point numbers is that have an adjacent representation
+    // i.e. for any finite floating point x there does not exist a finite floating point y such that
+    // ((float) ((int) x + 1)) &gt; y &gt; x (where int represents a signed bit integer with the same number
+    // of bits as float). Thus, if we have an array of floating points if we view it as an
+    // array of signed bit integers it will sort in the format we desire. Note, denormal
+    // numbers fit this property as they are floating point numbers with a exponent field of all
+    // zeros so they will be closer to the signed zeros than any normalized number.
+    //
+    // All the processors we support, however, use twos complement. Fortunately, if you compare a signed
+    // bit number as if it were twos complement the result will be correct assuming both numbers are not
+    // negative. e.g.
+    //
+    //    - &lt;=&gt; - = reversed (-30 &gt; -20 = true)
+    //    + &lt;=&gt; + = ordered (30 &gt; 20 = true)
+    //    - &lt;=&gt; + = ordered (-30 &gt; 20 = false)
+    //    + &lt;=&gt; - = ordered (30 &gt; -20 = true)
+    //
+    // For NaN, we normalize the NaN to a peticular representation; the sign bit is 0, all exponential bits
+    // are 1 and only the MSB of the mantissa is 1. So, NaN is recognized as the largest integral numbers.
+
+    void purifyArray()
+    {
+        ElementType* array = typedVector();
+        for (unsigned i = 0; i &lt; m_length; i++)
+            array[i] = purifyNaN(array[i]);
+    }
+
+    template&lt;typename IntegralType&gt;
+    static bool ALWAYS_INLINE sortComparison(IntegralType a, IntegralType b)
+    {
+        if (a &gt;= 0 || b &gt;= 0)
+            return a &lt; b;
+        return a &gt; b;
+    }
+
+    template&lt;typename IntegralType&gt;
+    void sortFloat()
+    {
+        ASSERT(sizeof(IntegralType) == sizeof(ElementType));
+
+        // Since there might be another view that sets the bits of
+        // our floats to NaNs with negative sign bits we need to
+        // purify the array.
+        // We use a separate function here to avoid the strict aliasing rule.
+        // We could use a union but ASAN seems to frown upon that.
+        purifyArray();
+
+        IntegralType* array = reinterpret_cast&lt;IntegralType*&gt;(typedVector());
+        std::sort(array, array + m_length, sortComparison&lt;IntegralType&gt;);
+
+    }
+
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> template&lt;typename Adaptor&gt;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSGenericTypedArrayViewInlinesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSGenericTypedArrayViewInlines.h (190366 => 190367)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSGenericTypedArrayViewInlines.h        2015-09-30 20:05:17 UTC (rev 190366)
+++ trunk/Source/JavaScriptCore/runtime/JSGenericTypedArrayViewInlines.h        2015-09-30 21:00:42 UTC (rev 190367)
</span><span class="lines">@@ -30,6 +30,7 @@
</span><span class="cx"> #include &quot;DeferGC.h&quot;
</span><span class="cx"> #include &quot;Error.h&quot;
</span><span class="cx"> #include &quot;ExceptionHelpers.h&quot;
</span><ins>+#include &quot;JSArrayBuffer.h&quot;
</ins><span class="cx"> #include &quot;JSGenericTypedArrayView.h&quot;
</span><span class="cx"> #include &quot;Reject.h&quot;
</span><span class="cx"> #include &quot;TypedArrays.h&quot;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSGenericTypedArrayViewPrototypeFunctionsh"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/runtime/JSGenericTypedArrayViewPrototypeFunctions.h (0 => 190367)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSGenericTypedArrayViewPrototypeFunctions.h                                (rev 0)
+++ trunk/Source/JavaScriptCore/runtime/JSGenericTypedArrayViewPrototypeFunctions.h        2015-09-30 21:00:42 UTC (rev 190367)
</span><span class="lines">@@ -0,0 +1,399 @@
</span><ins>+/*
+ * Copyright (C) 2015 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef JSGenericTypedArrayViewPrototypeFunctions_h
+#define JSGenericTypedArrayViewPrototypeFunctions_h
+
+#include &quot;ArrayPrototype.h&quot;
+#include &quot;Error.h&quot;
+#include &quot;ExceptionHelpers.h&quot;
+#include &quot;JSArrayBufferViewInlines.h&quot;
+#include &quot;JSArrayIterator.h&quot;
+#include &quot;JSCBuiltins.h&quot;
+#include &quot;JSCJSValueInlines.h&quot;
+#include &quot;JSFunction.h&quot;
+#include &quot;JSGenericTypedArrayViewInlines.h&quot;
+#include &quot;JSGenericTypedArrayViewPrototypeInlines.h&quot;
+#include &quot;JSStringJoiner.h&quot;
+#include &quot;StructureInlines.h&quot;
+#include &quot;TypedArrayAdaptors.h&quot;
+#include &lt;wtf/StdLibExtras.h&gt;
+
+namespace JSC {
+
+inline unsigned argumentClampedIndexFromStartOrEnd(ExecState* exec, int argument, unsigned length, unsigned undefinedValue = 0)
+{
+    JSValue value = exec-&gt;argument(argument);
+    if (value.isUndefined())
+        return undefinedValue;
+
+    double indexDouble = value.toInteger(exec);
+    if (indexDouble &lt; 0) {
+        indexDouble += length;
+        return indexDouble &lt; 0 ? 0 : static_cast&lt;unsigned&gt;(indexDouble);
+    }
+    return indexDouble &gt; length ? length : static_cast&lt;unsigned&gt;(indexDouble);
+}
+
+template&lt;typename ViewClass&gt;
+EncodedJSValue JSC_HOST_CALL genericTypedArrayViewProtoFuncSet(ExecState* exec)
+{
+    // 22.2.3.22
+    ViewClass* thisObject = jsCast&lt;ViewClass*&gt;(exec-&gt;thisValue());
+
+    if (!exec-&gt;argumentCount())
+        return throwVMError(exec, createTypeError(exec, &quot;Expected at least one argument&quot;));
+
+    JSObject* sourceArray = jsDynamicCast&lt;JSObject*&gt;(exec-&gt;uncheckedArgument(0));
+    if (!sourceArray)
+        return throwVMError(exec, createTypeError(exec, &quot;First argument should be an object&quot;));
+
+    unsigned offset;
+    if (exec-&gt;argumentCount() &gt;= 2) {
+        offset = exec-&gt;uncheckedArgument(1).toUInt32(exec);
+        if (exec-&gt;hadException())
+            return JSValue::encode(jsUndefined());
+    } else
+        offset = 0;
+
+    unsigned length = sourceArray-&gt;get(exec, exec-&gt;vm().propertyNames-&gt;length).toUInt32(exec);
+    if (exec-&gt;hadException())
+        return JSValue::encode(jsUndefined());
+
+    thisObject-&gt;set(exec, sourceArray, offset, length);
+    return JSValue::encode(jsUndefined());
+}
+
+template&lt;typename ViewClass&gt;
+EncodedJSValue JSC_HOST_CALL genericTypedArrayViewProtoFuncEntries(ExecState* exec)
+{
+    // 22.2.3.6
+    ViewClass* thisObject = jsCast&lt;ViewClass*&gt;(exec-&gt;thisValue());
+
+    return JSValue::encode(JSArrayIterator::create(exec, exec-&gt;callee()-&gt;globalObject()-&gt;arrayIteratorStructure(), ArrayIterateKeyValue, thisObject));
+}
+
+template&lt;typename ViewClass&gt;
+EncodedJSValue JSC_HOST_CALL genericTypedArrayViewProtoFuncCopyWithin(ExecState* exec)
+{
+    // 22.2.3.5
+    ViewClass* thisObject = jsCast&lt;ViewClass*&gt;(exec-&gt;thisValue());
+
+    if (exec-&gt;argumentCount() &lt; 2)
+        return throwVMError(exec, createTypeError(exec, &quot;Expected at least two arguments&quot;));
+
+    if (exec-&gt;hadException())
+        return JSValue::encode(jsUndefined());
+
+    long length = thisObject-&gt;length();
+    long to = argumentClampedIndexFromStartOrEnd(exec, 0, length);
+    long from = argumentClampedIndexFromStartOrEnd(exec, 1, length);
+    long final = argumentClampedIndexFromStartOrEnd(exec, 2, length, length);
+
+    if (final &lt; from)
+        return JSValue::encode(exec-&gt;thisValue());
+
+    long count = std::min(length - std::max(to, from), final - from);
+
+    typename ViewClass::ElementType* array = thisObject-&gt;typedVector();
+    memmove(array + to, array + from, count * thisObject-&gt;elementSize);
+
+    return JSValue::encode(exec-&gt;thisValue());
+}
+
+template&lt;typename ViewClass&gt;
+EncodedJSValue JSC_HOST_CALL genericTypedArrayViewProtoFuncFill(ExecState* exec)
+{
+    // 22.2.3.8
+    ViewClass* thisObject = jsCast&lt;ViewClass*&gt;(exec-&gt;thisValue());
+
+    JSValue valueToInsert = exec-&gt;argument(0);
+    if (exec-&gt;hadException())
+        return JSValue::encode(jsUndefined());
+
+    unsigned length = thisObject-&gt;length();
+    unsigned begin = argumentClampedIndexFromStartOrEnd(exec, 1, length);
+    unsigned end = argumentClampedIndexFromStartOrEnd(exec, 2, length, length);
+
+    if (end &lt; begin)
+        return JSValue::encode(exec-&gt;thisValue());
+
+    if (!thisObject-&gt;setRangeToValue(exec, begin, end, valueToInsert))
+        return JSValue::encode(jsUndefined());
+
+    return JSValue::encode(exec-&gt;thisValue());
+}
+
+template&lt;typename ViewClass&gt;
+EncodedJSValue JSC_HOST_CALL genericTypedArrayViewProtoFuncIndexOf(ExecState* exec)
+{
+    // 22.2.3.13
+    ViewClass* thisObject = jsCast&lt;ViewClass*&gt;(exec-&gt;thisValue());
+
+    if (!exec-&gt;argumentCount())
+        return throwVMError(exec, createTypeError(exec, &quot;Expected at least one argument&quot;));
+
+    unsigned length = thisObject-&gt;length();
+
+    JSValue valueToFind = exec-&gt;argument(0);
+    unsigned index = argumentClampedIndexFromStartOrEnd(exec, 1, length);
+
+    auto targetOpt = ViewClass::toAdaptorNativeFromValue(exec, valueToFind);
+    if (!targetOpt)
+        return JSValue::encode(jsUndefined());
+
+    typename ViewClass::ElementType target = targetOpt.value();
+    typename ViewClass::ElementType* array = thisObject-&gt;typedVector();
+
+    for (; index &lt; length; ++index) {
+        if (array[index] == target)
+            return JSValue::encode(jsNumber(index));
+    }
+
+    return JSValue::encode(jsNumber(-1));
+}
+
+template&lt;typename ViewClass&gt;
+EncodedJSValue JSC_HOST_CALL genericTypedArrayViewProtoFuncJoin(ExecState* exec)
+{
+    // 22.2.3.14
+    ViewClass* thisObject = jsCast&lt;ViewClass*&gt;(exec-&gt;thisValue());
+
+    unsigned length = thisObject-&gt;length();
+
+    JSValue separatorValue = exec-&gt;argument(0);
+    JSString* separatorString;
+    StringView separator;
+
+    if (separatorValue.isUndefined()) {
+        const LChar* comma = reinterpret_cast&lt;const LChar*&gt;(&quot;,&quot;);
+        separator = { comma, 1 };
+    } else {
+        separatorString = separatorValue.toString(exec);
+        if (exec-&gt;hadException())
+            return JSValue::encode(jsUndefined());
+        separator = separatorString-&gt;view(exec);
+    }
+
+    JSStringJoiner joiner(*exec, separator, length);
+    if (exec-&gt;hadException())
+        return JSValue::encode(jsUndefined());
+
+    for (unsigned i = 0; i &lt; length; i++) {
+        joiner.append(*exec, thisObject-&gt;getIndexQuickly(i));
+        if (exec-&gt;hadException())
+            return JSValue::encode(jsUndefined());
+    }
+
+    return JSValue::encode(joiner.join(*exec));
+}
+
+template&lt;typename ViewClass&gt;
+EncodedJSValue JSC_HOST_CALL genericTypedArrayViewProtoFuncKeys(ExecState* exec)
+{
+    // 22.2.3.15
+    ViewClass* thisObject = jsCast&lt;ViewClass*&gt;(exec-&gt;thisValue());
+
+    return JSValue::encode(JSArrayIterator::create(exec, exec-&gt;callee()-&gt;globalObject()-&gt;arrayIteratorStructure(), ArrayIterateKey, thisObject));
+}
+
+template&lt;typename ViewClass&gt;
+EncodedJSValue JSC_HOST_CALL genericTypedArrayViewProtoFuncLastIndexOf(ExecState* exec)
+{
+    // 22.2.3.16
+    ViewClass* thisObject = jsCast&lt;ViewClass*&gt;(exec-&gt;thisValue());
+
+    if (!exec-&gt;argumentCount())
+        return throwVMError(exec, createTypeError(exec, &quot;Expected at least one argument&quot;));
+
+    unsigned length = thisObject-&gt;length();
+
+    JSValue valueToFind = exec-&gt;argument(0);
+
+    int index = length - 1;
+    if (exec-&gt;argumentCount() &gt;= 2) {
+        JSValue fromValue = exec-&gt;uncheckedArgument(1);
+        double fromDouble = fromValue.toInteger(exec);
+        if (fromDouble &lt; 0) {
+            fromDouble += length;
+            if (fromDouble &lt; 0)
+                return JSValue::encode(jsNumber(-1));
+        }
+        if (fromDouble &lt; length)
+            index = static_cast&lt;unsigned&gt;(fromDouble);
+    }
+
+    auto targetOpt = ViewClass::toAdaptorNativeFromValue(exec, valueToFind);
+    if (!targetOpt)
+        return JSValue::encode(jsUndefined());
+
+    typename ViewClass::ElementType target = targetOpt.value();
+    typename ViewClass::ElementType* array = thisObject-&gt;typedVector();
+
+
+    for (; index &gt;= 0; --index) {
+        if (array[index] == target)
+            return JSValue::encode(jsNumber(index));
+    }
+
+    return JSValue::encode(jsNumber(-1));
+}
+
+template&lt;typename ViewClass&gt;
+EncodedJSValue JSC_HOST_CALL genericTypedArrayViewProtoGetterFuncLength(ExecState* exec)
+{
+    // 22.2.3.17
+    ViewClass* thisObject = jsCast&lt;ViewClass*&gt;(exec-&gt;thisValue());
+
+    return JSValue::encode(jsNumber(thisObject-&gt;length()));
+}
+
+template&lt;typename ViewClass&gt;
+EncodedJSValue JSC_HOST_CALL genericTypedArrayViewProtoGetterFuncByteLength(ExecState* exec)
+{
+    // 22.2.3.2
+    ViewClass* thisObject = jsCast&lt;ViewClass*&gt;(exec-&gt;thisValue());
+
+    return JSValue::encode(jsNumber(thisObject-&gt;byteLength()));
+}
+
+template&lt;typename ViewClass&gt;
+EncodedJSValue JSC_HOST_CALL genericTypedArrayViewProtoGetterFuncByteOffset(ExecState* exec)
+{
+    // 22.2.3.3
+    ViewClass* thisObject = jsCast&lt;ViewClass*&gt;(exec-&gt;thisValue());
+
+    return JSValue::encode(jsNumber(thisObject-&gt;byteOffset()));
+}
+
+
+template&lt;typename ViewClass&gt;
+EncodedJSValue JSC_HOST_CALL genericTypedArrayViewProtoFuncReverse(ExecState* exec)
+{
+    // 22.2.3.21
+    ViewClass* thisObject = jsCast&lt;ViewClass*&gt;(exec-&gt;thisValue());
+
+    typename ViewClass::ElementType* array = thisObject-&gt;typedVector();
+    std::reverse(array, array + thisObject-&gt;length());
+
+    return JSValue::encode(thisObject);
+}
+
+template&lt;typename ViewClass&gt;
+EncodedJSValue JSC_HOST_CALL genericTypedArrayViewPrivateFuncSort(ExecState* exec)
+{
+    // 22.2.3.25
+    ViewClass* thisObject = jsCast&lt;ViewClass*&gt;(exec-&gt;argument(0));
+
+    thisObject-&gt;sort();
+
+    return JSValue::encode(thisObject);
+}
+
+template&lt;typename ViewClass&gt;
+EncodedJSValue JSC_HOST_CALL genericTypedArrayViewProtoFuncSlice(ExecState* exec)
+{
+    // 22.2.3.26
+    JSFunction* callee = jsCast&lt;JSFunction*&gt;(exec-&gt;callee());
+
+    ViewClass* thisObject = jsCast&lt;ViewClass*&gt;(exec-&gt;thisValue());
+
+    if (!exec-&gt;argumentCount())
+        return throwVMError(exec, createTypeError(exec, &quot;Expected at least one argument&quot;));
+
+    unsigned thisLength = thisObject-&gt;length();
+
+    unsigned begin = argumentClampedIndexFromStartOrEnd(exec, 0, thisLength);
+    unsigned end = argumentClampedIndexFromStartOrEnd(exec, 1, thisLength, thisLength);
+
+    // Clamp end to begin.
+    end = std::max(begin, end);
+
+    ASSERT(end &gt;= begin);
+    unsigned length = end - begin;
+
+    typename ViewClass::ElementType* array = thisObject-&gt;typedVector();
+
+    Structure* structure =
+    callee-&gt;globalObject()-&gt;typedArrayStructure(ViewClass::TypedArrayStorageType);
+
+    ViewClass* result = ViewClass::createUninitialized(exec, structure, length);
+
+    // We can use memcpy since we know this a new buffer
+    memcpy(static_cast&lt;void*&gt;(result-&gt;typedVector()), static_cast&lt;void*&gt;(array + begin), length * thisObject-&gt;elementSize);
+
+    return JSValue::encode(result);
+}
+
+template&lt;typename ViewClass&gt;
+EncodedJSValue JSC_HOST_CALL genericTypedArrayViewProtoFuncSubarray(ExecState* exec)
+{
+    // 22.2.3.23
+    JSFunction* callee = jsCast&lt;JSFunction*&gt;(exec-&gt;callee());
+
+    ViewClass* thisObject = jsCast&lt;ViewClass*&gt;(exec-&gt;thisValue());
+
+    if (!exec-&gt;argumentCount())
+        return throwVMError(exec, createTypeError(exec, &quot;Expected at least one argument&quot;));
+
+    // Get the length here; later assert that the length didn't change.
+    unsigned thisLength = thisObject-&gt;length();
+
+    unsigned begin = argumentClampedIndexFromStartOrEnd(exec, 0, thisLength);
+    unsigned end = argumentClampedIndexFromStartOrEnd(exec, 1, thisLength, thisLength);
+
+    // Clamp end to begin.
+    end = std::max(begin, end);
+
+    ASSERT(end &gt;= begin);
+    unsigned offset = begin;
+    unsigned length = end - begin;
+
+    RefPtr&lt;ArrayBuffer&gt; arrayBuffer = thisObject-&gt;buffer();
+    RELEASE_ASSERT(thisLength == thisObject-&gt;length());
+
+    Structure* structure =
+    callee-&gt;globalObject()-&gt;typedArrayStructure(ViewClass::TypedArrayStorageType);
+
+    ViewClass* result = ViewClass::create(
+        exec, structure, arrayBuffer,
+        thisObject-&gt;byteOffset() + offset * ViewClass::elementSize,
+        length);
+
+    return JSValue::encode(result);
+}
+
+template&lt;typename ViewClass&gt;
+EncodedJSValue JSC_HOST_CALL typedArrayViewProtoFuncValues(ExecState* exec)
+{
+    // 22.2.3.29
+    ViewClass* thisObject = jsCast&lt;ViewClass*&gt;(exec-&gt;thisValue());
+
+    return JSValue::encode(JSArrayIterator::create(exec, exec-&gt;callee()-&gt;globalObject()-&gt;arrayIteratorStructure(), ArrayIterateValue, thisObject));
+}
+
+} // namespace JSC
+
+#endif /* JSGenericTypedArrayViewPrototypeFunctions_h */
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSGenericTypedArrayViewPrototypeInlinesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSGenericTypedArrayViewPrototypeInlines.h (190366 => 190367)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSGenericTypedArrayViewPrototypeInlines.h        2015-09-30 20:05:17 UTC (rev 190366)
+++ trunk/Source/JavaScriptCore/runtime/JSGenericTypedArrayViewPrototypeInlines.h        2015-09-30 21:00:42 UTC (rev 190367)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2013 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2013-2015 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -26,105 +26,11 @@
</span><span class="cx"> #ifndef JSGenericTypedArrayViewPrototypeInlines_h
</span><span class="cx"> #define JSGenericTypedArrayViewPrototypeInlines_h
</span><span class="cx"> 
</span><del>-#include &quot;Error.h&quot;
-#include &quot;ExceptionHelpers.h&quot;
-#include &quot;JSFunction.h&quot;
</del><span class="cx"> #include &quot;JSGenericTypedArrayViewPrototype.h&quot;
</span><del>-#include &lt;wtf/StdLibExtras.h&gt;
</del><span class="cx"> 
</span><span class="cx"> namespace JSC {
</span><del>-
-template&lt;typename ViewClass&gt;
-EncodedJSValue JSC_HOST_CALL genericTypedArrayViewProtoFuncSet(ExecState* exec)
-{
-    ViewClass* thisObject = jsDynamicCast&lt;ViewClass*&gt;(exec-&gt;thisValue());
-    if (!thisObject)
-        return throwVMError(exec, createTypeError(exec, &quot;Receiver should be a typed array view&quot;));
</del><span class="cx">     
</span><del>-    if (!exec-&gt;argumentCount())
-        return throwVMError(exec, createTypeError(exec, &quot;Expected at least one argument&quot;));
-    
-    JSObject* sourceArray = jsDynamicCast&lt;JSObject*&gt;(exec-&gt;uncheckedArgument(0));
-    if (!sourceArray)
-        return throwVMError(exec, createTypeError(exec, &quot;First argument should be an object&quot;));
-    
-    unsigned offset;
-    if (exec-&gt;argumentCount() &gt;= 2) {
-        offset = exec-&gt;uncheckedArgument(1).toUInt32(exec);
-        if (exec-&gt;hadException())
-            return JSValue::encode(jsUndefined());
-    } else
-        offset = 0;
-    
-    unsigned length = sourceArray-&gt;get(exec, exec-&gt;vm().propertyNames-&gt;length).toUInt32(exec);
-    if (exec-&gt;hadException())
-        return JSValue::encode(jsUndefined());
-    
-    thisObject-&gt;set(exec, sourceArray, offset, length);
-    return JSValue::encode(jsUndefined());
-}
-
</del><span class="cx"> template&lt;typename ViewClass&gt;
</span><del>-EncodedJSValue JSC_HOST_CALL genericTypedArrayViewProtoFuncSubarray(ExecState* exec)
-{
-    JSFunction* callee = jsCast&lt;JSFunction*&gt;(exec-&gt;callee());
-    
-    ViewClass* thisObject = jsDynamicCast&lt;ViewClass*&gt;(exec-&gt;thisValue());
-    if (!thisObject)
-        return throwVMError(exec, createTypeError(exec, &quot;Receiver should be a typed array view&quot;));
-    
-    if (!exec-&gt;argumentCount())
-        return throwVMError(exec, createTypeError(exec, &quot;Expected at least one argument&quot;));
-    
-    int32_t begin = exec-&gt;uncheckedArgument(0).toInt32(exec);
-    if (exec-&gt;hadException())
-        return JSValue::encode(jsUndefined());
-    
-    int32_t end;
-    if (exec-&gt;argumentCount() &gt;= 2) {
-        end = exec-&gt;uncheckedArgument(1).toInt32(exec);
-        if (exec-&gt;hadException())
-            return JSValue::encode(jsUndefined());
-    } else
-        end = thisObject-&gt;length();
-    
-    // Get the length here; later assert that the length didn't change.
-    unsigned thisLength = thisObject-&gt;length();
-    
-    // Handle negative indices: -x =&gt; length - x
-    if (begin &lt; 0)
-        begin = std::max(static_cast&lt;int&gt;(thisLength + begin), 0);
-    if (end &lt; 0)
-        end = std::max(static_cast&lt;int&gt;(thisLength + end), 0);
-    
-    // Clamp the indices to the bounds of the array.
-    ASSERT(begin &gt;= 0);
-    ASSERT(end &gt;= 0);
-    begin = std::min(begin, static_cast&lt;int32_t&gt;(thisLength));
-    end = std::min(end, static_cast&lt;int32_t&gt;(thisLength));
-    
-    // Clamp end to begin.
-    end = std::max(begin, end);
-    
-    ASSERT(end &gt;= begin);
-    unsigned offset = begin;
-    unsigned length = end - begin;
-    
-    RefPtr&lt;ArrayBuffer&gt; arrayBuffer = thisObject-&gt;buffer();
-    RELEASE_ASSERT(thisLength == thisObject-&gt;length());
-    
-    Structure* structure =
-        callee-&gt;globalObject()-&gt;typedArrayStructure(ViewClass::TypedArrayStorageType);
-    
-    ViewClass* result = ViewClass::create(
-        exec, structure, arrayBuffer,
-        thisObject-&gt;byteOffset() + offset * ViewClass::elementSize,
-        length);
-    
-    return JSValue::encode(result);
-}
-
-template&lt;typename ViewClass&gt;
</del><span class="cx"> JSGenericTypedArrayViewPrototype&lt;ViewClass&gt;::JSGenericTypedArrayViewPrototype(VM&amp; vm, Structure* structure)
</span><span class="cx">     : Base(vm, structure)
</span><span class="cx"> {
</span><span class="lines">@@ -132,15 +38,14 @@
</span><span class="cx"> 
</span><span class="cx"> template&lt;typename ViewClass&gt;
</span><span class="cx"> void JSGenericTypedArrayViewPrototype&lt;ViewClass&gt;::finishCreation(
</span><del>-    VM&amp; vm, JSGlobalObject* globalObject)
</del><ins>+    VM&amp; vm, JSGlobalObject*)
</ins><span class="cx"> {
</span><span class="cx">     Base::finishCreation(vm);
</span><span class="cx">     
</span><span class="cx">     ASSERT(inherits(info()));
</span><del>-    
-    JSC_NATIVE_FUNCTION(vm.propertyNames-&gt;set, genericTypedArrayViewProtoFuncSet&lt;ViewClass&gt;, DontEnum, 2);
-    JSC_NATIVE_FUNCTION(vm.propertyNames-&gt;subarray, genericTypedArrayViewProtoFuncSubarray&lt;ViewClass&gt;, DontEnum, 2);
</del><ins>+
</ins><span class="cx">     putDirect(vm, vm.propertyNames-&gt;BYTES_PER_ELEMENT, jsNumber(ViewClass::elementSize), DontEnum | ReadOnly | DontDelete);
</span><ins>+
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> template&lt;typename ViewClass&gt;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSGlobalObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSGlobalObject.cpp (190366 => 190367)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSGlobalObject.cpp        2015-09-30 20:05:17 UTC (rev 190366)
+++ trunk/Source/JavaScriptCore/runtime/JSGlobalObject.cpp        2015-09-30 21:00:42 UTC (rev 190367)
</span><span class="lines">@@ -99,6 +99,7 @@
</span><span class="cx"> #include &quot;JSTemplateRegistryKey.h&quot;
</span><span class="cx"> #include &quot;JSTypedArrayConstructors.h&quot;
</span><span class="cx"> #include &quot;JSTypedArrayPrototypes.h&quot;
</span><ins>+#include &quot;JSTypedArrayViewPrototype.h&quot;
</ins><span class="cx"> #include &quot;JSTypedArrays.h&quot;
</span><span class="cx"> #include &quot;JSWASMModule.h&quot;
</span><span class="cx"> #include &quot;JSWeakMap.h&quot;
</span><span class="lines">@@ -294,16 +295,18 @@
</span><span class="cx">     protoAccessor-&gt;setSetter(vm, this, JSFunction::create(vm, this, 0, String(), globalFuncProtoSetter));
</span><span class="cx">     m_objectPrototype-&gt;putDirectNonIndexAccessor(vm, vm.propertyNames-&gt;underscoreProto, protoAccessor, Accessor | DontEnum);
</span><span class="cx">     m_functionPrototype-&gt;structure()-&gt;setPrototypeWithoutTransition(vm, m_objectPrototype.get());
</span><del>-    
-    m_typedArrays[toIndex(TypeInt8)].prototype.set(vm, this, JSInt8ArrayPrototype::create(vm, this, JSInt8ArrayPrototype::createStructure(vm, this, m_objectPrototype.get())));
-    m_typedArrays[toIndex(TypeInt16)].prototype.set(vm, this, JSInt16ArrayPrototype::create(vm, this, JSInt16ArrayPrototype::createStructure(vm, this, m_objectPrototype.get())));
-    m_typedArrays[toIndex(TypeInt32)].prototype.set(vm, this, JSInt32ArrayPrototype::create(vm, this, JSInt32ArrayPrototype::createStructure(vm, this, m_objectPrototype.get())));
-    m_typedArrays[toIndex(TypeUint8)].prototype.set(vm, this, JSUint8ArrayPrototype::create(vm, this, JSUint8ArrayPrototype::createStructure(vm, this, m_objectPrototype.get())));
-    m_typedArrays[toIndex(TypeUint8Clamped)].prototype.set(vm, this, JSUint8ClampedArrayPrototype::create(vm, this, JSUint8ClampedArrayPrototype::createStructure(vm, this, m_objectPrototype.get())));
-    m_typedArrays[toIndex(TypeUint16)].prototype.set(vm, this, JSUint16ArrayPrototype::create(vm, this, JSUint16ArrayPrototype::createStructure(vm, this, m_objectPrototype.get())));
-    m_typedArrays[toIndex(TypeUint32)].prototype.set(vm, this, JSUint32ArrayPrototype::create(vm, this, JSUint32ArrayPrototype::createStructure(vm, this, m_objectPrototype.get())));
-    m_typedArrays[toIndex(TypeFloat32)].prototype.set(vm, this, JSFloat32ArrayPrototype::create(vm, this, JSFloat32ArrayPrototype::createStructure(vm, this, m_objectPrototype.get())));
-    m_typedArrays[toIndex(TypeFloat64)].prototype.set(vm, this, JSFloat64ArrayPrototype::create(vm, this, JSFloat64ArrayPrototype::createStructure(vm, this, m_objectPrototype.get())));
</del><ins>+
+    JSTypedArrayViewPrototype* typedArrayProto = JSTypedArrayViewPrototype::create(vm, this, JSTypedArrayViewPrototype::createStructure(vm, this, m_objectPrototype.get()));
+
+    m_typedArrays[toIndex(TypeInt8)].prototype.set(vm, this, JSInt8ArrayPrototype::create(vm, this, JSInt8ArrayPrototype::createStructure(vm, this, typedArrayProto)));
+    m_typedArrays[toIndex(TypeInt16)].prototype.set(vm, this, JSInt16ArrayPrototype::create(vm, this, JSInt16ArrayPrototype::createStructure(vm, this, typedArrayProto)));
+    m_typedArrays[toIndex(TypeInt32)].prototype.set(vm, this, JSInt32ArrayPrototype::create(vm, this, JSInt32ArrayPrototype::createStructure(vm, this, typedArrayProto)));
+    m_typedArrays[toIndex(TypeUint8)].prototype.set(vm, this, JSUint8ArrayPrototype::create(vm, this, JSUint8ArrayPrototype::createStructure(vm, this, typedArrayProto)));
+    m_typedArrays[toIndex(TypeUint8Clamped)].prototype.set(vm, this, JSUint8ClampedArrayPrototype::create(vm, this, JSUint8ClampedArrayPrototype::createStructure(vm, this, typedArrayProto)));
+    m_typedArrays[toIndex(TypeUint16)].prototype.set(vm, this, JSUint16ArrayPrototype::create(vm, this, JSUint16ArrayPrototype::createStructure(vm, this, typedArrayProto)));
+    m_typedArrays[toIndex(TypeUint32)].prototype.set(vm, this, JSUint32ArrayPrototype::create(vm, this, JSUint32ArrayPrototype::createStructure(vm, this, typedArrayProto)));
+    m_typedArrays[toIndex(TypeFloat32)].prototype.set(vm, this, JSFloat32ArrayPrototype::create(vm, this, JSFloat32ArrayPrototype::createStructure(vm, this, typedArrayProto)));
+    m_typedArrays[toIndex(TypeFloat64)].prototype.set(vm, this, JSFloat64ArrayPrototype::create(vm, this, JSFloat64ArrayPrototype::createStructure(vm, this, typedArrayProto)));
</ins><span class="cx">     m_typedArrays[toIndex(TypeDataView)].prototype.set(vm, this, JSDataViewPrototype::create(vm, JSDataViewPrototype::createStructure(vm, this, m_objectPrototype.get())));
</span><span class="cx">     
</span><span class="cx">     m_typedArrays[toIndex(TypeInt8)].structure.set(vm, this, JSInt8Array::createStructure(vm, this, m_typedArrays[toIndex(TypeInt8)].prototype.get()));
</span><span class="lines">@@ -487,6 +490,8 @@
</span><span class="cx">     JSFunction* privateFuncGetTemplateObject = JSFunction::create(vm, this, 0, String(), getTemplateObject);
</span><span class="cx">     JSFunction* privateFuncToLength = JSFunction::createBuiltinFunction(vm, globalObjectToLengthCodeGenerator(vm), this);
</span><span class="cx">     JSFunction* privateFuncToInteger = JSFunction::createBuiltinFunction(vm, globalObjectToIntegerCodeGenerator(vm), this);
</span><ins>+    JSFunction* privateFuncTypedArrayLength = JSFunction::create(vm, this, 0, String(), typedArrayViewPrivateFuncLength);
+    JSFunction* privateFuncTypedArraySort = JSFunction::create(vm, this, 0, String(), typedArrayViewPrivateFuncSort);
</ins><span class="cx"> 
</span><span class="cx">     GlobalPropertyInfo staticGlobals[] = {
</span><span class="cx">         GlobalPropertyInfo(vm.propertyNames-&gt;NaN, jsNaN(), DontEnum | DontDelete | ReadOnly),
</span><span class="lines">@@ -498,6 +503,8 @@
</span><span class="cx">         GlobalPropertyInfo(vm.propertyNames-&gt;getTemplateObjectPrivateName, privateFuncGetTemplateObject, DontEnum | DontDelete | ReadOnly),
</span><span class="cx">         GlobalPropertyInfo(vm.propertyNames-&gt;enqueueJobPrivateName, JSFunction::create(vm, this, 0, String(), enqueueJob), DontEnum | DontDelete | ReadOnly),
</span><span class="cx">         GlobalPropertyInfo(vm.propertyNames-&gt;TypeErrorPrivateName, m_typeErrorConstructor.get(), DontEnum | DontDelete | ReadOnly),
</span><ins>+        GlobalPropertyInfo(vm.propertyNames-&gt;typedArrayLengthPrivateName, privateFuncTypedArrayLength, DontEnum | DontDelete | ReadOnly),
+        GlobalPropertyInfo(vm.propertyNames-&gt;typedArraySortPrivateName, privateFuncTypedArraySort, DontEnum | DontDelete | ReadOnly),
</ins><span class="cx">         GlobalPropertyInfo(vm.propertyNames-&gt;BuiltinLogPrivateName, builtinLog, DontEnum | DontDelete | ReadOnly),
</span><span class="cx">         GlobalPropertyInfo(vm.propertyNames-&gt;ArrayPrivateName, arrayConstructor, DontEnum | DontDelete | ReadOnly),
</span><span class="cx">         GlobalPropertyInfo(vm.propertyNames-&gt;NumberPrivateName, numberConstructor, DontEnum | DontDelete | ReadOnly),
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSObjecth"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSObject.h (190366 => 190367)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSObject.h        2015-09-30 20:05:17 UTC (rev 190366)
+++ trunk/Source/JavaScriptCore/runtime/JSObject.h        2015-09-30 21:00:42 UTC (rev 190367)
</span><span class="lines">@@ -1475,6 +1475,16 @@
</span><span class="cx">     putDirectBuiltinFunction(\
</span><span class="cx">         vm, globalObject, makeIdentifier(vm, (jsName)), (generatorName)(vm), (attributes))
</span><span class="cx"> 
</span><ins>+// Helper for defining native getters on properties.
+#define JSC_NATIVE_GETTER(jsName, cppName, attributes, length) do { \
+        Identifier ident = makeIdentifier(vm, (jsName)); \
+        GetterSetter* accessor = GetterSetter::create(vm, globalObject); \
+        JSFunction* function = JSFunction::create(vm, globalObject, (length), ident.string(), (cppName)); \
+        accessor-&gt;setGetter(vm, globalObject, function); \
+        putDirectNonIndexAccessor(vm, ident, accessor, (attributes) | Accessor); \
+    } while (false)
+
+
</ins><span class="cx"> } // namespace JSC
</span><span class="cx"> 
</span><span class="cx"> #endif // JSObject_h
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSTypedArrayPrototypescpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSTypedArrayPrototypes.cpp (190366 => 190367)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSTypedArrayPrototypes.cpp        2015-09-30 20:05:17 UTC (rev 190366)
+++ trunk/Source/JavaScriptCore/runtime/JSTypedArrayPrototypes.cpp        2015-09-30 21:00:42 UTC (rev 190367)
</span><span class="lines">@@ -31,6 +31,9 @@
</span><span class="cx"> 
</span><span class="cx"> namespace JSC {
</span><span class="cx"> 
</span><ins>+const ClassInfo JSTypedArrayViewPrototype::s_info = {&quot;Prototype&quot;, &amp;JSTypedArrayViewPrototype::Base::s_info, 0,
+    CREATE_METHOD_TABLE(JSTypedArrayViewPrototype)};
+
</ins><span class="cx"> #define MAKE_S_INFO(type) \
</span><span class="cx">     template&lt;&gt; const ClassInfo JS##type##Prototype::s_info = {#type &quot;Prototype&quot;, &amp;JS##type##Prototype::Base::s_info, 0, CREATE_METHOD_TABLE(JS##type##Prototype)}
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSTypedArrayPrototypesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSTypedArrayPrototypes.h (190366 => 190367)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSTypedArrayPrototypes.h        2015-09-30 20:05:17 UTC (rev 190366)
+++ trunk/Source/JavaScriptCore/runtime/JSTypedArrayPrototypes.h        2015-09-30 21:00:42 UTC (rev 190367)
</span><span class="lines">@@ -27,6 +27,7 @@
</span><span class="cx"> #define JSTypedArrayPrototypes_h
</span><span class="cx"> 
</span><span class="cx"> #include &quot;JSGenericTypedArrayViewPrototype.h&quot;
</span><ins>+#include &quot;JSTypedArrayViewPrototype.h&quot;
</ins><span class="cx"> #include &quot;JSTypedArrays.h&quot;
</span><span class="cx"> 
</span><span class="cx"> namespace JSC {
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSTypedArrayViewPrototypecpp"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/runtime/JSTypedArrayViewPrototype.cpp (0 => 190367)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSTypedArrayViewPrototype.cpp                                (rev 0)
+++ trunk/Source/JavaScriptCore/runtime/JSTypedArrayViewPrototype.cpp        2015-09-30 21:00:42 UTC (rev 190367)
</span><span class="lines">@@ -0,0 +1,266 @@
</span><ins>+/*
+ * Copyright (C) 2015 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include &quot;config.h&quot;
+#include &quot;JSTypedArrayViewPrototype.h&quot;
+
+#include &quot;CallFrame.h&quot;
+#include &quot;GetterSetter.h&quot;
+#include &quot;JSCellInlines.h&quot;
+#include &quot;JSFunction.h&quot;
+#include &quot;JSGenericTypedArrayViewPrototypeFunctions.h&quot;
+#include &quot;TypedArrayAdaptors.h&quot;
+
+namespace JSC {
+
+#define CALL_GENERIC_TYPEDARRAY_PROTOTYPE_FUNCTION(functionName) do {                           \
+    switch (thisValue.getObject()-&gt;classInfo()-&gt;typedArrayStorageType) {                        \
+    case TypeUint8Clamped:                                                                      \
+        return functionName&lt;JSUint8ClampedArray&gt;(exec);                                         \
+    case TypeInt32:                                                                             \
+        return functionName&lt;JSInt32Array&gt;(exec);                                                \
+    case TypeUint32:                                                                            \
+        return functionName&lt;JSUint32Array&gt;(exec);                                               \
+    case TypeFloat64:                                                                           \
+        return functionName&lt;JSFloat64Array&gt;(exec);                                              \
+    case TypeFloat32:                                                                           \
+        return functionName&lt;JSFloat32Array&gt;(exec);                                              \
+    case TypeInt8:                                                                              \
+        return functionName&lt;JSInt8Array&gt;(exec);                                                 \
+    case TypeUint8:                                                                             \
+        return functionName&lt;JSUint8Array&gt;(exec);                                                \
+    case TypeInt16:                                                                             \
+        return functionName&lt;JSInt16Array&gt;(exec);                                                \
+    case TypeUint16:                                                                            \
+        return functionName&lt;JSUint16Array&gt;(exec);                                               \
+    case NotTypedArray:                                                                         \
+    case TypeDataView:                                                                          \
+        return throwVMError(exec, createTypeError(exec,                                         \
+            &quot;Receiver should be a typed array view&quot;));                                          \
+    }                                                                                           \
+    RELEASE_ASSERT_NOT_REACHED();                                                               \
+} while (false)
+
+EncodedJSValue JSC_HOST_CALL typedArrayViewPrivateFuncLength(ExecState* exec)
+{
+    JSArrayBufferView* thisObject = jsDynamicCast&lt;JSArrayBufferView*&gt;(exec-&gt;argument(0));
+    if (!thisObject)
+        return throwVMError(exec, createTypeError(exec, &quot;Receiver should be a typed array view&quot;));
+
+    return JSValue::encode(jsNumber(thisObject-&gt;length()));
+}
+
+EncodedJSValue JSC_HOST_CALL typedArrayViewPrivateFuncSort(ExecState* exec)
+{
+    JSValue thisValue = exec-&gt;argument(0);
+    if (!thisValue.isObject())
+        return throwVMError(exec, createTypeError(exec, &quot;Receiver should be a typed array view but was not an object&quot;));
+    CALL_GENERIC_TYPEDARRAY_PROTOTYPE_FUNCTION(genericTypedArrayViewPrivateFuncSort);
+}
+
+static EncodedJSValue JSC_HOST_CALL typedArrayViewProtoFuncSet(ExecState* exec)
+{
+    JSValue thisValue = exec-&gt;thisValue();
+    if (!thisValue.isObject())
+        return throwVMError(exec, createTypeError(exec, &quot;Receiver should be a typed array view but was not an object&quot;));
+    CALL_GENERIC_TYPEDARRAY_PROTOTYPE_FUNCTION(genericTypedArrayViewProtoFuncSet);
+}
+
+static EncodedJSValue JSC_HOST_CALL typedArrayViewProtoFuncEntries(ExecState* exec)
+{
+    JSValue thisValue = exec-&gt;thisValue();
+    if (!thisValue.isObject())
+        return throwVMError(exec, createTypeError(exec, &quot;Receiver should be a typed array view but was not an object&quot;));
+    CALL_GENERIC_TYPEDARRAY_PROTOTYPE_FUNCTION(genericTypedArrayViewProtoFuncEntries);
+}
+
+static EncodedJSValue JSC_HOST_CALL typedArrayViewProtoFuncCopyWithin(ExecState* exec)
+{
+    JSValue thisValue = exec-&gt;thisValue();
+    if (!thisValue.isObject())
+        return throwVMError(exec, createTypeError(exec, &quot;Receiver should be a typed array view but was not an object&quot;));
+    CALL_GENERIC_TYPEDARRAY_PROTOTYPE_FUNCTION(genericTypedArrayViewProtoFuncCopyWithin);
+}
+
+static EncodedJSValue JSC_HOST_CALL typedArrayViewProtoFuncFill(ExecState* exec)
+{
+    JSValue thisValue = exec-&gt;thisValue();
+    if (!thisValue.isObject())
+        return throwVMError(exec, createTypeError(exec, &quot;Receiver should be a typed array view but was not an object&quot;));
+    CALL_GENERIC_TYPEDARRAY_PROTOTYPE_FUNCTION(genericTypedArrayViewProtoFuncFill);
+}
+
+static EncodedJSValue JSC_HOST_CALL typedArrayViewProtoFuncLastIndexOf(ExecState* exec)
+{
+    JSValue thisValue = exec-&gt;thisValue();
+    if (!thisValue.isObject())
+        return throwVMError(exec, createTypeError(exec, &quot;Receiver should be a typed array view but was not an object&quot;));
+    CALL_GENERIC_TYPEDARRAY_PROTOTYPE_FUNCTION(genericTypedArrayViewProtoFuncLastIndexOf);
+}
+
+static EncodedJSValue JSC_HOST_CALL typedArrayViewProtoFuncIndexOf(ExecState* exec)
+{
+    JSValue thisValue = exec-&gt;thisValue();
+    if (!thisValue.isObject())
+        return throwVMError(exec, createTypeError(exec, &quot;Receiver should be a typed array view but was not an object&quot;));
+    CALL_GENERIC_TYPEDARRAY_PROTOTYPE_FUNCTION(genericTypedArrayViewProtoFuncIndexOf);
+}
+
+static EncodedJSValue JSC_HOST_CALL typedArrayViewProtoFuncJoin(ExecState* exec)
+{
+    JSValue thisValue = exec-&gt;thisValue();
+    if (!thisValue.isObject())
+        return throwVMError(exec, createTypeError(exec, &quot;Receiver should be a typed array view but was not an object&quot;));
+    CALL_GENERIC_TYPEDARRAY_PROTOTYPE_FUNCTION(genericTypedArrayViewProtoFuncJoin);
+}
+
+static EncodedJSValue JSC_HOST_CALL typedArrayViewProtoFuncKeys(ExecState* exec)
+{
+    JSValue thisValue = exec-&gt;thisValue();
+    if (!thisValue.isObject())
+        return throwVMError(exec, createTypeError(exec, &quot;Receiver should be a typed array view but was not an object&quot;));
+    CALL_GENERIC_TYPEDARRAY_PROTOTYPE_FUNCTION(genericTypedArrayViewProtoFuncKeys);
+}
+
+static EncodedJSValue JSC_HOST_CALL typedArrayViewProtoGetterFuncLength(ExecState* exec)
+{
+    JSValue thisValue = exec-&gt;thisValue();
+    if (!thisValue.isObject())
+        return throwVMError(exec, createTypeError(exec, &quot;Receiver should be a typed array view but was not an object&quot;));
+    CALL_GENERIC_TYPEDARRAY_PROTOTYPE_FUNCTION(genericTypedArrayViewProtoGetterFuncLength);
+}
+
+static EncodedJSValue JSC_HOST_CALL typedArrayViewProtoGetterFuncByteLength(ExecState* exec)
+{
+    JSValue thisValue = exec-&gt;thisValue();
+    if (!thisValue.isObject())
+        return throwVMError(exec, createTypeError(exec, &quot;Receiver should be a typed array view but was not an object&quot;));
+    CALL_GENERIC_TYPEDARRAY_PROTOTYPE_FUNCTION(genericTypedArrayViewProtoGetterFuncByteLength);
+}
+
+static EncodedJSValue JSC_HOST_CALL typedArrayViewProtoGetterFuncByteOffset(ExecState* exec)
+{
+    JSValue thisValue = exec-&gt;thisValue();
+    if (!thisValue.isObject())
+        return throwVMError(exec, createTypeError(exec, &quot;Receiver should be a typed array view but was not an object&quot;));
+    CALL_GENERIC_TYPEDARRAY_PROTOTYPE_FUNCTION(genericTypedArrayViewProtoGetterFuncByteOffset);
+}
+
+static EncodedJSValue JSC_HOST_CALL typedArrayViewProtoFuncReverse(ExecState* exec)
+{
+    JSValue thisValue = exec-&gt;thisValue();
+    if (!thisValue.isObject())
+        return throwVMError(exec, createTypeError(exec, &quot;Receiver should be a typed array view but was not an object&quot;));
+    CALL_GENERIC_TYPEDARRAY_PROTOTYPE_FUNCTION(genericTypedArrayViewProtoFuncReverse);
+}
+
+static EncodedJSValue JSC_HOST_CALL typedArrayViewProtoFuncSubarray(ExecState* exec)
+{
+    JSValue thisValue = exec-&gt;thisValue();
+    if (!thisValue.isObject())
+        return throwVMError(exec, createTypeError(exec, &quot;Receiver should be a typed array view but was not an object&quot;));
+    CALL_GENERIC_TYPEDARRAY_PROTOTYPE_FUNCTION(genericTypedArrayViewProtoFuncSubarray);
+}
+
+static EncodedJSValue JSC_HOST_CALL typedArrayViewProtoFuncSlice(ExecState* exec)
+{
+    JSValue thisValue = exec-&gt;thisValue();
+    if (!thisValue.isObject())
+        return throwVMError(exec, createTypeError(exec, &quot;Receiver should be a typed array view but was not an object&quot;));
+    CALL_GENERIC_TYPEDARRAY_PROTOTYPE_FUNCTION(genericTypedArrayViewProtoFuncSlice);
+}
+
+static EncodedJSValue JSC_HOST_CALL typedArrayViewProtoFuncValues(ExecState* exec)
+{
+    JSValue thisValue = exec-&gt;thisValue();
+    if (!thisValue.isObject())
+        return throwVMError(exec, createTypeError(exec, &quot;Receiver should be a typed array view but was not an object&quot;));
+    CALL_GENERIC_TYPEDARRAY_PROTOTYPE_FUNCTION(typedArrayViewProtoFuncValues);
+}
+
+#undef CALL_GENERIC_TYPEDARRAY_PROTOTYPE_FUNCTION
+
+JSTypedArrayViewPrototype::JSTypedArrayViewPrototype(VM&amp; vm, Structure* structure)
+    : Base(vm, structure)
+{
+}
+
+void JSTypedArrayViewPrototype::finishCreation(VM&amp; vm, JSGlobalObject* globalObject)
+{
+    Base::finishCreation(vm);
+
+    ASSERT(inherits(info()));
+
+    JSC_NATIVE_GETTER(vm.propertyNames-&gt;byteLength, typedArrayViewProtoGetterFuncByteLength, DontEnum | ReadOnly | DontDelete, 0);
+    JSC_NATIVE_GETTER(vm.propertyNames-&gt;byteOffset, typedArrayViewProtoGetterFuncByteOffset, DontEnum | ReadOnly | DontDelete, 0);
+    JSC_NATIVE_FUNCTION(&quot;copyWithin&quot;, typedArrayViewProtoFuncCopyWithin, DontEnum, 2);
+    JSC_BUILTIN_FUNCTION(&quot;every&quot;, typedArrayPrototypeEveryCodeGenerator, DontEnum);
+    JSC_BUILTIN_FUNCTION(&quot;filter&quot;, typedArrayPrototypeFilterCodeGenerator, DontEnum);
+    JSC_BUILTIN_FUNCTION(&quot;sort&quot;, typedArrayPrototypeSortCodeGenerator, DontEnum);
+    JSC_NATIVE_FUNCTION(vm.propertyNames-&gt;entries, typedArrayViewProtoFuncEntries, DontEnum, 0);
+    JSC_NATIVE_FUNCTION(&quot;fill&quot;, typedArrayViewProtoFuncFill, DontEnum, 1);
+    JSC_BUILTIN_FUNCTION(&quot;find&quot;, typedArrayPrototypeFindCodeGenerator, DontEnum);
+    JSC_BUILTIN_FUNCTION(&quot;findIndex&quot;, typedArrayPrototypeFindIndexCodeGenerator, DontEnum);
+    JSC_BUILTIN_FUNCTION(vm.propertyNames-&gt;forEach, typedArrayPrototypeForEachCodeGenerator, DontEnum);
+    JSC_NATIVE_FUNCTION(&quot;indexOf&quot;, typedArrayViewProtoFuncIndexOf, DontEnum, 1);
+    JSC_NATIVE_FUNCTION(vm.propertyNames-&gt;join, typedArrayViewProtoFuncJoin, DontEnum, 1);
+    JSC_NATIVE_FUNCTION(vm.propertyNames-&gt;keys, typedArrayViewProtoFuncKeys, DontEnum, 0);
+    JSC_NATIVE_FUNCTION(&quot;lastIndexOf&quot;, typedArrayViewProtoFuncLastIndexOf, DontEnum, 1);
+    JSC_NATIVE_GETTER(vm.propertyNames-&gt;length, typedArrayViewProtoGetterFuncLength, DontEnum | ReadOnly | DontDelete, 0);
+    JSC_BUILTIN_FUNCTION(&quot;map&quot;, typedArrayPrototypeMapCodeGenerator, DontEnum);
+    JSC_BUILTIN_FUNCTION(&quot;reduce&quot;, typedArrayPrototypeReduceCodeGenerator, DontEnum);
+    JSC_BUILTIN_FUNCTION(&quot;reduceRight&quot;, typedArrayPrototypeReduceRightCodeGenerator, DontEnum);
+    JSC_NATIVE_FUNCTION(&quot;reverse&quot;, typedArrayViewProtoFuncReverse, DontEnum, 0);
+    JSC_NATIVE_FUNCTION(vm.propertyNames-&gt;set, typedArrayViewProtoFuncSet, DontEnum, 1);
+    JSC_NATIVE_FUNCTION(vm.propertyNames-&gt;slice, typedArrayViewProtoFuncSlice, DontEnum, 2);
+    JSC_BUILTIN_FUNCTION(&quot;some&quot;, typedArrayPrototypeSomeCodeGenerator, DontEnum);
+    JSC_NATIVE_FUNCTION(vm.propertyNames-&gt;subarray, typedArrayViewProtoFuncSubarray, DontEnum, 2);
+    JSC_BUILTIN_FUNCTION(vm.propertyNames-&gt;toLocaleString, typedArrayPrototypeToLocaleStringCodeGenerator, DontEnum);
+    JSC_NATIVE_FUNCTION(vm.propertyNames-&gt;toString, arrayProtoFuncToString, DontEnum, 0);
+
+    JSFunction* valuesFunction = JSFunction::create(vm, globalObject, 0, vm.propertyNames-&gt;values.string(), typedArrayViewProtoFuncValues);
+
+    putDirectWithoutTransition(vm, vm.propertyNames-&gt;values, valuesFunction, DontEnum);
+    putDirectWithoutTransition(vm, vm.propertyNames-&gt;iteratorSymbol, valuesFunction, DontEnum);
+
+}
+
+JSTypedArrayViewPrototype* JSTypedArrayViewPrototype::create(
+    VM&amp; vm, JSGlobalObject* globalObject, Structure* structure)
+{
+    JSTypedArrayViewPrototype* prototype =
+    new (NotNull, allocateCell&lt;JSTypedArrayViewPrototype&gt;(vm.heap))
+    JSTypedArrayViewPrototype(vm, structure);
+    prototype-&gt;finishCreation(vm, globalObject);
+    return prototype;
+}
+
+Structure* JSTypedArrayViewPrototype::createStructure(
+    VM&amp; vm, JSGlobalObject* globalObject, JSValue prototype)
+{
+    return Structure::create(vm, globalObject, prototype, TypeInfo(ObjectType, StructureFlags), info());
+}
+
+} // namespace JSC
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSTypedArrayViewPrototypehfromrev190366trunkSourceJavaScriptCoreruntimeJSTypedArrayPrototypescpp"></a>
<div class="copfile"><h4>Copied: trunk/Source/JavaScriptCore/runtime/JSTypedArrayViewPrototype.h (from rev 190366, trunk/Source/JavaScriptCore/runtime/JSTypedArrayPrototypes.cpp) (0 => 190367)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSTypedArrayViewPrototype.h                                (rev 0)
+++ trunk/Source/JavaScriptCore/runtime/JSTypedArrayViewPrototype.h        2015-09-30 21:00:42 UTC (rev 190367)
</span><span class="lines">@@ -0,0 +1,55 @@
</span><ins>+/*
+ * Copyright (C) 2015 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef JSTypedArrayViewPrototype_h
+#define JSTypedArrayViewPrototype_h
+
+#include &quot;JSObject.h&quot;
+
+namespace JSC {
+
+class JSTypedArrayViewPrototype : public JSNonFinalObject {
+public:
+    typedef JSNonFinalObject Base;
+
+protected:
+    JSTypedArrayViewPrototype(VM&amp;, Structure*);
+    void finishCreation(VM&amp;, JSGlobalObject*);
+
+public:
+    static JSTypedArrayViewPrototype* create(VM&amp;, JSGlobalObject*, Structure*);
+
+    DECLARE_INFO;
+
+    static Structure* createStructure(VM&amp;, JSGlobalObject*, JSValue prototype);
+};
+
+EncodedJSValue JSC_HOST_CALL typedArrayViewPrivateFuncSort(ExecState*);
+EncodedJSValue JSC_HOST_CALL typedArrayViewPrivateFuncLength(ExecState*);
+
+    
+} // namespace JSC
+
+#endif /* JSTypedArrayViewPrototype_h */
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoretestses6yaml"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/tests/es6.yaml (190366 => 190367)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/tests/es6.yaml        2015-09-30 20:05:17 UTC (rev 190366)
+++ trunk/Source/JavaScriptCore/tests/es6.yaml        2015-09-30 21:00:42 UTC (rev 190367)
</span><span class="lines">@@ -1119,47 +1119,47 @@
</span><span class="cx"> - path: es6/typed_arrays_%TypedArray%.of.js
</span><span class="cx">   cmd: runES6 :fail
</span><span class="cx"> - path: es6/typed_arrays_%TypedArray%.prototype.copyWithin.js
</span><del>-  cmd: runES6 :fail
</del><ins>+  cmd: runES6 :normal
</ins><span class="cx"> - path: es6/typed_arrays_%TypedArray%.prototype.entries.js
</span><del>-  cmd: runES6 :fail
</del><ins>+  cmd: runES6 :normal
</ins><span class="cx"> - path: es6/typed_arrays_%TypedArray%.prototype.every.js
</span><del>-  cmd: runES6 :fail
</del><ins>+  cmd: runES6 :normal
</ins><span class="cx"> - path: es6/typed_arrays_%TypedArray%.prototype.fill.js
</span><del>-  cmd: runES6 :fail
</del><ins>+  cmd: runES6 :normal
</ins><span class="cx"> - path: es6/typed_arrays_%TypedArray%.prototype.filter.js
</span><del>-  cmd: runES6 :fail
</del><ins>+  cmd: runES6 :normal
</ins><span class="cx"> - path: es6/typed_arrays_%TypedArray%.prototype.find.js
</span><del>-  cmd: runES6 :fail
</del><ins>+  cmd: runES6 :normal
</ins><span class="cx"> - path: es6/typed_arrays_%TypedArray%.prototype.findIndex.js
</span><del>-  cmd: runES6 :fail
</del><ins>+  cmd: runES6 :normal
</ins><span class="cx"> - path: es6/typed_arrays_%TypedArray%.prototype.forEach.js
</span><del>-  cmd: runES6 :fail
</del><ins>+  cmd: runES6 :normal
</ins><span class="cx"> - path: es6/typed_arrays_%TypedArray%.prototype.indexOf.js
</span><del>-  cmd: runES6 :fail
</del><ins>+  cmd: runES6 :normal
</ins><span class="cx"> - path: es6/typed_arrays_%TypedArray%.prototype.join.js
</span><del>-  cmd: runES6 :fail
</del><ins>+  cmd: runES6 :normal
</ins><span class="cx"> - path: es6/typed_arrays_%TypedArray%.prototype.keys.js
</span><del>-  cmd: runES6 :fail
</del><ins>+  cmd: runES6 :normal
</ins><span class="cx"> - path: es6/typed_arrays_%TypedArray%.prototype.lastIndexOf.js
</span><del>-  cmd: runES6 :fail
</del><ins>+  cmd: runES6 :normal
</ins><span class="cx"> - path: es6/typed_arrays_%TypedArray%.prototype.map.js
</span><del>-  cmd: runES6 :fail
</del><ins>+  cmd: runES6 :normal
</ins><span class="cx"> - path: es6/typed_arrays_%TypedArray%.prototype.reduce.js
</span><del>-  cmd: runES6 :fail
</del><ins>+  cmd: runES6 :normal
</ins><span class="cx"> - path: es6/typed_arrays_%TypedArray%.prototype.reduceRight.js
</span><del>-  cmd: runES6 :fail
</del><ins>+  cmd: runES6 :normal
</ins><span class="cx"> - path: es6/typed_arrays_%TypedArray%.prototype.reverse.js
</span><del>-  cmd: runES6 :fail
</del><ins>+  cmd: runES6 :normal
</ins><span class="cx"> - path: es6/typed_arrays_%TypedArray%.prototype.slice.js
</span><del>-  cmd: runES6 :fail
</del><ins>+  cmd: runES6 :normal
</ins><span class="cx"> - path: es6/typed_arrays_%TypedArray%.prototype.some.js
</span><del>-  cmd: runES6 :fail
</del><ins>+  cmd: runES6 :normal
</ins><span class="cx"> - path: es6/typed_arrays_%TypedArray%.prototype.sort.js
</span><del>-  cmd: runES6 :fail
</del><ins>+  cmd: runES6 :normal
</ins><span class="cx"> - path: es6/typed_arrays_%TypedArray%.prototype.values.js
</span><del>-  cmd: runES6 :fail
</del><ins>+  cmd: runES6 :normal
</ins><span class="cx"> - path: es6/typed_arrays_%TypedArray%.prototype[Symbol.iterator].js
</span><del>-  cmd: runES6 :fail
</del><ins>+  cmd: runES6 :normal
</ins><span class="cx"> - path: es6/typed_arrays_%TypedArray%[Symbol.species].js
</span><span class="cx">   cmd: runES6 :fail
</span><span class="cx"> - path: es6/typed_arrays_ArrayBuffer[Symbol.species].js
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoretestsstressresourcesstandaloneprejs"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/tests/stress/resources/standalone-pre.js (0 => 190367)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/tests/stress/resources/standalone-pre.js                                (rev 0)
+++ trunk/Source/JavaScriptCore/tests/stress/resources/standalone-pre.js        2015-09-30 21:00:42 UTC (rev 190367)
</span><span class="lines">@@ -0,0 +1,332 @@
</span><ins>+var errorMessage;
+var self = this;
+
+self.testRunner = {
+    neverInlineFunction: neverInlineFunction,
+    numberOfDFGCompiles: numberOfDFGCompiles
+};
+
+var silentMode = true;
+var silentTestPass, didPassSomeTestsSilently, didFailSomeTests, successfullyParsed;
+silentTestPass = false;
+didPassSomeTestsSilenty = false;
+didFaileSomeTests = false;
+
+function description(msg)
+{
+    if (silentMode)
+        return;
+    print(msg);
+    print(&quot;\nOn success, you will see a series of \&quot;PASS\&quot; messages, followed by \&quot;TEST COMPLETE\&quot;.\n&quot;);
+    print();
+}
+
+function debug(msg)
+{
+    if (silentMode)
+        return;
+    print(msg);
+}
+
+function escapeString(text)
+{
+    return text.replace(/\0/g, &quot;&quot;);
+}
+
+function testPassed(msg)
+{
+    if (silentTestPass)
+        didPassSomeTestsSilently = true;
+    else if (silentMode)
+        return;
+    else
+        print(&quot;PASS&quot;, escapeString(msg));
+}
+
+function testFailed(msg)
+{
+    didFailSomeTests = true;
+    if (silentMode)
+        return;
+    print(&quot;FAIL&quot;, escapeString(msg));
+}
+
+function areNumbersEqual(_actual, _expected)
+{
+    if (_expected === 0)
+        return _actual === _expected &amp;&amp; (1/_actual) === (1/_expected);
+    if (_actual === _expected)
+        return true;
+    if (typeof(_expected) == &quot;number&quot; &amp;&amp; isNaN(_expected))
+        return typeof(_actual) == &quot;number&quot; &amp;&amp; isNaN(_actual);
+    return false;
+}
+
+function areArraysEqual(_a, _b)
+{
+    try {
+        if (_a.length !== _b.length)
+            return false;
+        for (var i = 0; i &lt; _a.length; i++)
+            if (!areNumbersEqual(_a[i], _b[i]))
+                return false;
+    } catch (ex) {
+        return false;
+    }
+    return true;
+}
+
+function isMinusZero(n)
+{
+    // the only way to tell 0 from -0 in JS is the fact that 1/-0 is
+    // -Infinity instead of Infinity
+    return n === 0 &amp;&amp; 1/n &lt; 0;
+}
+
+function isTypedArray(array)
+{
+    return array instanceof Int8Array
+        || array instanceof Int16Array
+        || array instanceof Int32Array
+        || array instanceof Uint8Array
+        || array instanceof Uint8ClampedArray
+        || array instanceof Uint16Array
+        || array instanceof Uint32Array
+        || array instanceof Float32Array
+        || array instanceof Float64Array;
+}
+
+function isResultCorrect(_actual, _expected)
+{
+    if (areNumbersEqual(_actual, _expected))
+        return true;
+    if (_expected
+        &amp;&amp; (Object.prototype.toString.call(_expected) ==
+            Object.prototype.toString.call([])
+            || isTypedArray(_expected)))
+        return areArraysEqual(_actual, _expected);
+    return false;
+}
+
+function stringify(v)
+{
+    if (v === 0 &amp;&amp; 1/v &lt; 0)
+        return &quot;-0&quot;;
+    else if (isTypedArray(v))
+        return v.__proto__.constructor.name + &quot;:[&quot; + Array.prototype.join.call(v, &quot;,&quot;) + &quot;]&quot;;
+    else
+        return &quot;&quot; + v;
+}
+
+function shouldBe(_a, _b)
+{
+  if (typeof _a != &quot;string&quot; || typeof _b != &quot;string&quot;)
+    debug(&quot;WARN: shouldBe() expects string arguments&quot;);
+  var exception;
+  var _av;
+  try {
+     _av = eval(_a);
+  } catch (e) {
+     exception = e;
+  }
+  var _bv = eval(_b);
+
+  if (exception)
+    testFailed(_a + &quot; should be &quot; + stringify(_bv) + &quot;. Threw exception &quot; + exception);
+  else if (isResultCorrect(_av, _bv))
+    testPassed(_a + &quot; is &quot; + _b);
+  else if (typeof(_av) == typeof(_bv))
+    testFailed(_a + &quot; should be &quot; + stringify(_bv) + &quot;. Was &quot; + stringify(_av) + &quot;.&quot;);
+  else
+    testFailed(_a + &quot; should be &quot; + stringify(_bv) + &quot; (of type &quot; + typeof _bv + &quot;). Was &quot; + _av + &quot; (of type &quot; + typeof _av + &quot;).&quot;);
+}
+
+function dfgShouldBe(theFunction, _a, _b)
+{
+  if (typeof theFunction != &quot;function&quot; || typeof _a != &quot;string&quot; || typeof _b != &quot;string&quot;)
+    debug(&quot;WARN: dfgShouldBe() expects a function and two strings&quot;);
+  noInline(theFunction);
+  var exception;
+  var values = [];
+
+  // Defend against tests that muck with numeric properties on array.prototype.
+  values.__proto__ = null;
+  values.push = Array.prototype.push;
+  
+  try {
+    while (!dfgCompiled({f:theFunction}))
+      values.push(eval(_a));
+    values.push(eval(_a));
+  } catch (e) {
+    exception = e;
+  }
+
+  var _bv = eval(_b);
+  if (exception)
+    testFailed(_a + &quot; should be &quot; + stringify(_bv) + &quot;. On iteration &quot; + (values.length + 1) + &quot;, threw exception &quot; + exception);
+  else {
+    var allPassed = true;
+    for (var i = 0; i &lt; values.length; ++i) {
+      var _av = values[i];
+      if (isResultCorrect(_av, _bv))
+        continue;
+      if (typeof(_av) == typeof(_bv))
+        testFailed(_a + &quot; should be &quot; + stringify(_bv) + &quot;. On iteration &quot; + (i + 1) + &quot;, was &quot; + stringify(_av) + &quot;.&quot;);
+      else
+        testFailed(_a + &quot; should be &quot; + stringify(_bv) + &quot; (of type &quot; + typeof _bv + &quot;). On iteration &quot; + (i + 1) + &quot;, was &quot; + _av + &quot; (of type &quot; + typeof _av + &quot;).&quot;);
+      allPassed = false;
+    }
+    if (allPassed)
+      testPassed(_a + &quot; is &quot; + _b + &quot; on all iterations including after DFG tier-up.&quot;);
+  }
+  
+  return values.length;
+}
+
+function shouldBeType(_a, _type) {
+  var exception;
+  var _av;
+  try {
+    _av = eval(_a);
+  } catch (e) {
+    exception = e;
+  }
+
+  var _typev = eval(_type);
+  if (_av instanceof _typev) {
+    testPassed(_a + &quot; is an instance of &quot; + _type);
+  } else {
+    testFailed(_a + &quot; is not an instance of &quot; + _type);
+  }
+}
+
+function shouldBeTrue(_a) { shouldBe(_a, &quot;true&quot;); }
+function shouldBeFalse(_a) { shouldBe(_a, &quot;false&quot;); }
+function shouldBeNaN(_a) { shouldBe(_a, &quot;NaN&quot;); }
+function shouldBeNull(_a) { shouldBe(_a, &quot;null&quot;); }
+
+function shouldBeEqualToString(a, b)
+{
+  if (typeof a !== &quot;string&quot; || typeof b !== &quot;string&quot;)
+    debug(&quot;WARN: shouldBeEqualToString() expects string arguments&quot;);
+  var unevaledString = JSON.stringify(b);
+  shouldBe(a, unevaledString);
+}
+
+function shouldBeUndefined(_a)
+{
+  var exception;
+  var _av;
+  try {
+     _av = eval(_a);
+  } catch (e) {
+     exception = e;
+  }
+
+  if (exception)
+    testFailed(_a + &quot; should be undefined. Threw exception &quot; + exception);
+  else if (typeof _av == &quot;undefined&quot;)
+    testPassed(_a + &quot; is undefined.&quot;);
+  else
+    testFailed(_a + &quot; should be undefined. Was &quot; + _av);
+}
+
+function shouldNotThrow(_a) {
+    try {
+        eval(_a);
+        testPassed(_a + &quot; did not throw exception.&quot;);
+    } catch (e) {
+        testFailed(_a + &quot; should not throw exception. Threw exception &quot; + e + &quot;.&quot;);
+    }
+}
+
+function shouldThrow(_a, _e)
+{
+  var exception;
+  var _av;
+  try {
+     _av = eval(_a);
+  } catch (e) {
+     exception = e;
+  }
+
+  var _ev;
+  if (_e)
+      _ev =  eval(_e);
+
+  if (exception) {
+    if (typeof _e == &quot;undefined&quot; || exception == _ev)
+      testPassed(_a + &quot; threw exception &quot; + exception + &quot;.&quot;);
+    else
+      testFailed(_a + &quot; should throw &quot; + (typeof _e == &quot;undefined&quot; ? &quot;an exception&quot; : _ev) + &quot;. Threw exception &quot; + exception + &quot;.&quot;);
+  } else if (typeof _av == &quot;undefined&quot;)
+    testFailed(_a + &quot; should throw &quot; + (typeof _e == &quot;undefined&quot; ? &quot;an exception&quot; : _ev) + &quot;. Was undefined.&quot;);
+  else
+    testFailed(_a + &quot; should throw &quot; + (typeof _e == &quot;undefined&quot; ? &quot;an exception&quot; : _ev) + &quot;. Was &quot; + _av + &quot;.&quot;);
+}
+
+function isSuccessfullyParsed()
+{
+    // FIXME: Remove this and only report unexpected syntax errors.
+    if (!errorMessage)
+        successfullyParsed = true;
+    shouldBeTrue(&quot;successfullyParsed&quot;);
+    if (silentTestPass &amp;&amp; didPassSomeTestsSilently)
+        debug(&quot;Passed some tests silently.&quot;);
+    if (silentTestPass &amp;&amp; didFailSomeTests)
+        debug(&quot;Some tests failed.&quot;);
+    debug(&quot;\nTEST COMPLETE\n&quot;);
+}
+
+
+function dfgCompiled(argument)
+{
+    var numberOfCompiles = &quot;compiles&quot; in argument ? argument.compiles : 1;
+    
+    if (!(&quot;f&quot; in argument))
+        throw new Error(&quot;dfgCompiled called with invalid argument.&quot;);
+    
+    if (argument.f instanceof Array) {
+        for (var i = 0; i &lt; argument.f.length; ++i) {
+            if (testRunner.numberOfDFGCompiles(argument.f[i]) &lt; numberOfCompiles)
+                return false;
+        }
+    } else {
+        if (testRunner.numberOfDFGCompiles(argument.f) &lt; numberOfCompiles)
+            return false;
+    }
+    
+    return true;
+}
+
+function dfgIncrement(argument)
+{
+    if (!self.testRunner)
+        return argument.i;
+    
+    if (argument.i &lt; argument.n)
+        return argument.i;
+    
+    if (didFailSomeTests)
+        return argument.i;
+    
+    if (!dfgCompiled(argument))
+        return &quot;start&quot; in argument ? argument.start : 0;
+    
+    return argument.i;
+}
+
+function noInline(theFunction)
+{
+    if (!self.testRunner)
+        return;
+    
+    testRunner.neverInlineFunction(theFunction);
+}
+
+function finishJSTest()
+{
+    isSuccessfullyParsed();
+    if (didFailSomeTests)
+        throw new Error(&quot;Some Tests Failed&quot;);
+}
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoretestsstressresourcestypedarraytesthelperfunctionsjs"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/tests/stress/resources/typedarray-test-helper-functions.js (0 => 190367)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/tests/stress/resources/typedarray-test-helper-functions.js                                (rev 0)
+++ trunk/Source/JavaScriptCore/tests/stress/resources/typedarray-test-helper-functions.js        2015-09-30 21:00:42 UTC (rev 190367)
</span><span class="lines">@@ -0,0 +1,103 @@
</span><ins>+load(&quot;./resources/standalone-pre.js&quot;);
+
+var typedArrays = [Int8Array, Uint8Array, Uint8ClampedArray, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, Float64Array];
+
+var signedArrays = [Int8Array, Int16Array, Int32Array, Float32Array, Float64Array];
+
+var floatArrays = [Float32Array, Float64Array];
+
+function forEachTypedArray(constructors, testFunction /* , initialValues */ ) {
+    let initialValues = arguments[2];
+    for (let i = 0; i &lt; constructors.length; ++i) {
+        let typedArray = constructors[i];
+
+        let array;
+        if (initialValues) {
+            array = new typedArray(initialValues);
+        } else
+            array = new typedArray();
+
+        let testResult = testFunction(array, typedArray)
+        if (testResult !== true)
+            return testResult;
+    }
+
+    return true;
+}
+
+function isSameFunctionForEachTypedArrayPrototype(name) {
+    function eq(array) { return array[name] === Int32Array.prototype[name]; }
+    return forEachTypedArray(typedArrays, eq);
+}
+
+function hasSameValues(msg, array1, array2) {
+    if (array1.length !== array2.length) {
+        debug(msg +  &quot; first array: &quot; + array1 + &quot; second array: &quot; + array2);
+        return false;
+    }
+
+    let allSame = true;
+    for (let i = 0; i &lt; array1.length; ++i) {
+        allSame = allSame &amp;&amp; Object.is(array1[i], array2[i]);
+    }
+
+    if (!allSame)
+        debug(msg +  &quot; first array: &quot; + array1 + &quot; second array: &quot; + array2);
+    return allSame;
+
+}
+
+function testPrototypeFunctionHelper(constructors, name, args, init, result, expectedArray) {
+
+    function foo(array, constructor) {
+        let res = eval(&quot;array.&quot; + name + args);
+
+        if (expectedArray) {
+            if (!hasSameValues(&quot;array did not change correctly on &quot; + constructor + &quot;,&quot;, array, expectedArray))
+                return false;
+        }
+
+        if (typeof result === &quot;object&quot;)
+            return hasSameValues(name + &quot; returned the wrong result on &quot; + constructor + &quot;,&quot;, res, result);
+        else {
+            if (res !== result) {
+                debug(name + &quot; returned the wrong result on &quot; + constructor + &quot;, returned: &quot; + res + &quot; but expected: &quot; + result);
+                return false;
+            }
+            return true;
+        }
+    }
+
+    return forEachTypedArray(constructors, foo, init);
+}
+
+function testPrototypeFunctionOnSigned(name, args, init, result /* expectedArray */) {
+    return testPrototypeFunctionHelper(signedArrays, name, args, init, result, arguments[4]);
+}
+
+function testPrototypeFunctionOnFloat(name, args, init, result /* expectedArray */) {
+    return testPrototypeFunctionHelper(floatArrays, name, args, init, result, arguments[4]);
+}
+
+function testPrototypeFunction(name, args, init, result /* expectedArray */) {
+    return testPrototypeFunctionHelper(typedArrays, name, args, init, result, arguments[4]);
+}
+
+function testPrototypeReceivesArray(name, thisValues) {
+    function tester (array, constructor) {
+        var passed = true;
+        for (var thisValue of thisValues) {
+            try {
+                eval(&quot;array.&quot; + name).call(thisValue);
+                passed = false;
+                debug(&quot;did not throw an error when given an invalid |this| on &quot; + constructor);
+            } catch (err) {}
+
+        }
+
+        return passed;
+    }
+
+    return forEachTypedArray(typedArrays, tester);
+}
+
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoretestsstresstypedarraycopyWithinjs"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/tests/stress/typedarray-copyWithin.js (0 => 190367)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/tests/stress/typedarray-copyWithin.js                                (rev 0)
+++ trunk/Source/JavaScriptCore/tests/stress/typedarray-copyWithin.js        2015-09-30 21:00:42 UTC (rev 190367)
</span><span class="lines">@@ -0,0 +1,16 @@
</span><ins>+load(&quot;./resources/typedarray-test-helper-functions.js&quot;);
+description(&quot;This test checks the behavior of the TypedArray.prototype.copyWithin function&quot;);
+
+
+shouldBe(&quot;Int32Array.prototype.copyWithin.length&quot;, &quot;2&quot;);
+shouldBe(&quot;Int32Array.prototype.copyWithin.name&quot;, &quot;'copyWithin'&quot;);
+
+shouldBeTrue(&quot;isSameFunctionForEachTypedArrayPrototype('copyWithin')&quot;);
+shouldBeTrue(&quot;testPrototypeReceivesArray('copyWithin', [undefined, this, { }, [ ], true, ''])&quot;);
+
+shouldBeTrue(&quot;testPrototypeFunction('copyWithin', '(0, 3)', [1, 2, 3, 4, 5], [4, 5, 3, 4, 5])&quot;);
+shouldBeTrue(&quot;testPrototypeFunction('copyWithin', '(0, 3, 4)', [1, 2, 3, 4, 5], [4, 2, 3, 4, 5])&quot;);
+shouldBeTrue(&quot;testPrototypeFunction('copyWithin', '(0, -2, -1)', [1, 2, 3, 4, 5], [4, 2, 3, 4, 5])&quot;);
+shouldBeTrue(&quot;testPrototypeFunction('copyWithin', '(5, -5, 5)', [1, 2, 3, 4, 5], [1, 2, 3, 4, 5])&quot;);
+shouldBeTrue(&quot;testPrototypeFunction('copyWithin', '(1, -5, 5)', [1, 2, 3, 4, 5], [1, 1, 2, 3, 4])&quot;);
+finishJSTest();
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoretestsstresstypedarrayeveryjs"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/tests/stress/typedarray-every.js (0 => 190367)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/tests/stress/typedarray-every.js                                (rev 0)
+++ trunk/Source/JavaScriptCore/tests/stress/typedarray-every.js        2015-09-30 21:00:42 UTC (rev 190367)
</span><span class="lines">@@ -0,0 +1,56 @@
</span><ins>+load(&quot;./resources/typedarray-test-helper-functions.js&quot;);
+description(
+&quot;This test checks the behavior of the TypedArray.prototype.every function&quot;
+);
+
+shouldBe(&quot;Int32Array.prototype.every.length&quot;, &quot;1&quot;);
+shouldBe(&quot;Int32Array.prototype.every.name&quot;, &quot;'every'&quot;);
+shouldBeTrue(&quot;isSameFunctionForEachTypedArrayPrototype('every')&quot;);
+shouldBeTrue(&quot;testPrototypeReceivesArray('every', [undefined, this, { }, [ ], true, ''])&quot;);
+debug(&quot;&quot;);
+
+debug(&quot;testPrototypeFunction has the following arg list (name, args, init, result [ , expectedArray ])&quot;);
+debug(&quot;&quot;);
+
+debug(&quot;1.0 Single Argument Testing&quot;);
+function isBigEnough(element, index, array) {
+    if (this.value)
+        return element &gt;= this.value;
+    return element &gt;= 10;
+}
+shouldBeTrue(&quot;testPrototypeFunction('every', '(isBigEnough)', [12, 5, 8, 13, 44], false)&quot;);
+shouldBeTrue(&quot;testPrototypeFunction('every', '(isBigEnough)', [12, 54, 18, 13, 44], true)&quot;);
+debug(&quot;&quot;);
+
+debug(&quot;2.0 Two Argument Testing&quot;);
+var thisValue = { value: 11 };
+shouldBeTrue(&quot;testPrototypeFunction('every', '(isBigEnough, thisValue)', [12, 15, 10, 13, 44], false)&quot;);
+shouldBeTrue(&quot;testPrototypeFunction('every', '(isBigEnough, thisValue)', [12, 54, 82, 13, 44], true)&quot;);
+debug(&quot;&quot;);
+
+debug(&quot;3.0 Array Element Changing&quot;);
+function isBigEnoughAndChange(element, index, array) {
+    array[array.length - 1 - index] = 5;
+    return (element &gt;= 10);
+}
+shouldBeTrue(&quot;testPrototypeFunction('every', '(isBigEnoughAndChange)', [12, 15, 1, 13, 44], false, [12, 15, 5, 5, 5])&quot;);
+shouldBeTrue(&quot;testPrototypeFunction('every', '(isBigEnoughAndChange)', [12, 15, 10, 13, 44], false, [12, 5, 5, 5, 5])&quot;);
+debug(&quot;&quot;);
+
+debug(&quot;4.0 Exception Test&quot;);
+function isBigEnoughAndException(element, index, array) {
+    if(index==1) throw &quot;exception from function&quot;;
+    return (element &gt;= 10);
+}
+shouldThrow(&quot;testPrototypeFunction('every', '(isBigEnoughAndException)', [12, 15, 10, 13, 44], false)&quot;);
+debug(&quot;&quot;);
+
+debug(&quot;5.0 Wrong Type for Callback Test&quot;);
+shouldThrow(&quot;testPrototypeFunction('every', '(8)', [12, 15, 10, 13, 44], false)&quot;);
+shouldThrow(&quot;testPrototypeFunction('every', '(\&quot;wrong\&quot;)', [12, 15, 10, 13, 44], false)&quot;);
+shouldThrow(&quot;testPrototypeFunction('every', '(new Object())', [12, 15, 10, 13, 44], false)&quot;);
+shouldThrow(&quot;testPrototypeFunction('every', '(null)', [12, 15, 10, 13, 44], false)&quot;);
+shouldThrow(&quot;testPrototypeFunction('every', '()', [12, 15, 10, 13, 44], false)&quot;);
+debug(&quot;&quot;);
+
+finishJSTest();
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoretestsstresstypedarrayfilljs"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/tests/stress/typedarray-fill.js (0 => 190367)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/tests/stress/typedarray-fill.js                                (rev 0)
+++ trunk/Source/JavaScriptCore/tests/stress/typedarray-fill.js        2015-09-30 21:00:42 UTC (rev 190367)
</span><span class="lines">@@ -0,0 +1,35 @@
</span><ins>+load(&quot;./resources/typedarray-test-helper-functions.js&quot;);
+description(
+&quot;This test checks the behavior of the TypedArray.prototype.fill function&quot;
+);
+
+shouldBe(&quot;Int32Array.prototype.fill.length&quot;, &quot;1&quot;);
+shouldBe(&quot;Int32Array.prototype.fill.name&quot;, &quot;'fill'&quot;);
+shouldBeTrue(&quot;isSameFunctionForEachTypedArrayPrototype('fill')&quot;);
+shouldBeTrue(&quot;testPrototypeReceivesArray('fill', [undefined, this, { }, [ ], true, ''])&quot;);
+debug(&quot;&quot;);
+
+debug(&quot;testPrototypeFunction has the following arg list (name, args, init, result [ , expectedArray ])&quot;);
+debug(&quot;&quot;);
+
+debug(&quot;1.0 Single Argument Testing&quot;);
+shouldBeTrue(&quot;testPrototypeFunction('fill', '(12)', [15, 5, 8, 13, 44], [12,12,12,12,12])&quot;);
+shouldBeTrue(&quot;testPrototypeFunction('fill', '(true)', [12, 54, 18, 13, 44], [1,1,1,1,1])&quot;);
+debug(&quot;&quot;);
+
+debug(&quot;2.0 Two Argument Testing&quot;);
+shouldBeTrue(&quot;testPrototypeFunction('fill', '(12, 2)', [14, 15, 10, 13, 44], [14, 15, 12, 12, 12])&quot;);
+shouldBeTrue(&quot;testPrototypeFunction('fill', '(4, NaN)', [14, 15, 10, 13, 44], [4, 4, 4, 4, 4])&quot;);
+shouldBeTrue(&quot;testPrototypeFunction('fill', '(4, -5)', [14, 15, 10, 13, 44], [4, 4, 4, 4, 4])&quot;);
+shouldBeTrue(&quot;testPrototypeFunction('fill', '(4, -1)', [14, 15, 10, 13, 44], [14, 15, 10, 13, 4])&quot;);
+debug(&quot;&quot;);
+
+debug(&quot;3.0 Three Argument Testing&quot;);
+shouldBeTrue(&quot;testPrototypeFunction('fill', '(4, -1, 0)', [14, 15, 10, 13, 44], [14, 15, 10, 13, 44])&quot;);
+shouldBeTrue(&quot;testPrototypeFunction('fill', '(4, 1, 1)', [14, 15, 10, 13, 44], [14, 15, 10, 13, 44])&quot;);
+shouldBeTrue(&quot;testPrototypeFunction('fill', '(4, 1, NaN)', [14, 15, 10, 13, 44], [14, 15, 10, 13, 44])&quot;);
+shouldBeTrue(&quot;testPrototypeFunction('fill', '(4, NaN, NaN)', [14, 15, 10, 13, 44], [14, 15, 10, 13, 44])&quot;);
+shouldBeTrue(&quot;testPrototypeFunction('fill', '(4, NaN, 5)', [14, 15, 10, 13, 44], [4, 4, 4, 4, 4])&quot;);
+shouldBeTrue(&quot;testPrototypeFunction('fill', '(4, -3, -2)', [14, 15, 10, 13, 44], [14, 15, 4, 13, 44])&quot;);
+shouldBeTrue(&quot;testPrototypeFunction('fill', '(4, 5, 5)', [14, 15, 10, 13, 44], [14, 15, 10, 13, 44])&quot;);
+finishJSTest();
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoretestsstresstypedarrayfilterjs"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/tests/stress/typedarray-filter.js (0 => 190367)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/tests/stress/typedarray-filter.js                                (rev 0)
+++ trunk/Source/JavaScriptCore/tests/stress/typedarray-filter.js        2015-09-30 21:00:42 UTC (rev 190367)
</span><span class="lines">@@ -0,0 +1,51 @@
</span><ins>+load(&quot;./resources/typedarray-test-helper-functions.js&quot;);
+description(
+&quot;This test checks the behavior of the TypedArray.prototype.filter function&quot;
+);
+
+shouldBe(&quot;Int32Array.prototype.filter.length&quot;, &quot;1&quot;);
+shouldBe(&quot;Int32Array.prototype.filter.name&quot;, &quot;'filter'&quot;);
+shouldBeTrue(&quot;isSameFunctionForEachTypedArrayPrototype('filter')&quot;);
+shouldBeTrue(&quot;testPrototypeReceivesArray('filter', [undefined, this, { }, [ ], true, ''])&quot;);
+debug(&quot;&quot;);
+
+debug(&quot;testPrototypeFunction has the following arg list (name, args, init, result [ , expectedArray ])&quot;);
+debug(&quot;&quot;);
+
+debug(&quot;1.0 Single Argument Testing&quot;);
+function keepEven(e, i) {
+    return !(e &amp; 1) || (this.keep ? this.keep.indexOf(i) &gt;= 0 : false);
+}
+shouldBeTrue(&quot;testPrototypeFunction('filter', '(keepEven)', [12, 5, 8, 13, 44], [12, 8, 44])&quot;);
+shouldBeTrue(&quot;testPrototypeFunction('filter', '(keepEven)', [11, 54, 18, 13, 1], [54, 18])&quot;);
+debug(&quot;&quot;);
+
+debug(&quot;2.0 Two Argument Testing&quot;);
+var thisValue = { keep: [1, 3] };
+shouldBeTrue(&quot;testPrototypeFunction('filter', '(keepEven, thisValue)', [12, 23, 11, 1, 45], [12, 23, 1])&quot;);
+debug(&quot;&quot;);
+
+debug(&quot;3.0 Array Element Changing&quot;);
+function keepEvenAndChange(e, i, a) {
+    a[a.length - 1 - i] = 5;
+    return !(e &amp; 1);
+}
+shouldBeTrue(&quot;testPrototypeFunction('filter', '(keepEvenAndChange)', [12, 15, 2, 13, 44], [12, 2], [5, 5, 5, 5, 5])&quot;);
+debug(&quot;&quot;);
+
+debug(&quot;4.0 Exception Test&quot;);
+function isBigEnoughAndException(element, index, array) {
+    if(index==1) throw &quot;exception from function&quot;;
+    return (element &gt;= 10);
+}
+shouldThrow(&quot;testPrototypeFunction('filter', '(isBigEnoughAndException)', [12, 15, 10, 13, 44], false)&quot;);
+debug(&quot;&quot;);
+
+debug(&quot;5.0 Wrong Type for Callback Test&quot;);
+shouldThrow(&quot;testPrototypeFunction('filter', '(8)', [12, 15, 10, 13, 44], false)&quot;);
+shouldThrow(&quot;testPrototypeFunction('filter', '(\&quot;wrong\&quot;)', [12, 15, 10, 13, 44], false)&quot;);
+shouldThrow(&quot;testPrototypeFunction('filter', '(new Object())', [12, 15, 10, 13, 44], false)&quot;);
+shouldThrow(&quot;testPrototypeFunction('filter', '(null)', [12, 15, 10, 13, 44], false)&quot;);
+shouldThrow(&quot;testPrototypeFunction('filter', '()', [12, 15, 10, 13, 44], false)&quot;);
+debug(&quot;&quot;);
+finishJSTest();
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoretestsstresstypedarrayfindjs"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/tests/stress/typedarray-find.js (0 => 190367)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/tests/stress/typedarray-find.js                                (rev 0)
+++ trunk/Source/JavaScriptCore/tests/stress/typedarray-find.js        2015-09-30 21:00:42 UTC (rev 190367)
</span><span class="lines">@@ -0,0 +1,53 @@
</span><ins>+load(&quot;./resources/typedarray-test-helper-functions.js&quot;);
+description(
+&quot;This test checks the behavior of the TypedArray.prototype.find function&quot;
+);
+
+shouldBe(&quot;Int32Array.prototype.find.length&quot;, &quot;1&quot;);
+shouldBe(&quot;Int32Array.prototype.find.name&quot;, &quot;'find'&quot;);
+shouldBeTrue(&quot;isSameFunctionForEachTypedArrayPrototype('find')&quot;);
+shouldBeTrue(&quot;testPrototypeReceivesArray('find', [undefined, this, { }, [ ], true, ''])&quot;);
+debug(&quot;&quot;);
+
+debug(&quot;testPrototypeFunction has the following arg list (name, args, init, result [ , expectedArray ])&quot;);
+debug(&quot;&quot;);
+
+debug(&quot;1.0 Single Argument Testing&quot;);
+function keepEven(e, i) {
+    return !(e &amp; 1) || (this.keep ? this.keep === i : false);
+}
+shouldBeTrue(&quot;testPrototypeFunction('find', '(keepEven)', [12, 5, 8, 13, 44], 12)&quot;);
+shouldBeTrue(&quot;testPrototypeFunction('find', '(keepEven)', [11, 13, 17, 13, 22], 22)&quot;);
+shouldBeTrue(&quot;testPrototypeFunction('find', '(keepEven)', [11, 13, 17, 13, 11], undefined)&quot;);
+debug(&quot;&quot;);
+
+debug(&quot;2.0 Two Argument Testing&quot;);
+var thisValue = { keep: 3 };
+shouldBeTrue(&quot;testPrototypeFunction('find', '(keepEven, thisValue)', [11, 23, 11, 1, 44], 1)&quot;);
+debug(&quot;&quot;);
+
+debug(&quot;3.0 Array Element Changing&quot;);
+function keepEvenAndChange(e, i, a) {
+    a[a.length - 1 - i] = 5;
+    return !(e &amp; 1);
+}
+shouldBeTrue(&quot;testPrototypeFunction('find', '(keepEvenAndChange)', [11, 15, 3, 12, 44], undefined, [5, 5, 5, 5, 5])&quot;);
+debug(&quot;&quot;);
+
+debug(&quot;4.0 Exception Test&quot;);
+function isBigEnoughAndException(element, index, array) {
+    if(index==1) throw &quot;exception from function&quot;;
+    return (element &gt;= 10);
+}
+shouldBeTrue(&quot;testPrototypeFunction('find', '(isBigEnoughAndException)', [12, 15, 10, 13, 44], 12)&quot;);
+shouldThrow(&quot;testPrototypeFunction('find', '(isBigEnoughAndException)', [9, 15, 10, 13, 44], false)&quot;);
+debug(&quot;&quot;);
+
+debug(&quot;5.0 Wrong Type for Callback Test&quot;);
+shouldThrow(&quot;testPrototypeFunction('find', '(8)', [12, 15, 10, 13, 44], false)&quot;);
+shouldThrow(&quot;testPrototypeFunction('find', '(\&quot;wrong\&quot;)', [12, 15, 10, 13, 44], false)&quot;);
+shouldThrow(&quot;testPrototypeFunction('find', '(new Object())', [12, 15, 10, 13, 44], false)&quot;);
+shouldThrow(&quot;testPrototypeFunction('find', '(null)', [12, 15, 10, 13, 44], false)&quot;);
+shouldThrow(&quot;testPrototypeFunction('find', '()', [12, 15, 10, 13, 44], false)&quot;);
+debug(&quot;&quot;);
+finishJSTest();
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoretestsstresstypedarrayfindIndexjs"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/tests/stress/typedarray-findIndex.js (0 => 190367)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/tests/stress/typedarray-findIndex.js                                (rev 0)
+++ trunk/Source/JavaScriptCore/tests/stress/typedarray-findIndex.js        2015-09-30 21:00:42 UTC (rev 190367)
</span><span class="lines">@@ -0,0 +1,53 @@
</span><ins>+load(&quot;./resources/typedarray-test-helper-functions.js&quot;);
+description(
+&quot;This test checks the behavior of the TypedArray.prototype.findIndex function&quot;
+);
+
+shouldBe(&quot;Int32Array.prototype.findIndex.length&quot;, &quot;1&quot;);
+shouldBe(&quot;Int32Array.prototype.findIndex.name&quot;, &quot;'findIndex'&quot;);
+shouldBeTrue(&quot;isSameFunctionForEachTypedArrayPrototype('findIndex')&quot;);
+shouldBeTrue(&quot;testPrototypeReceivesArray('findIndex', [undefined, this, { }, [ ], true, ''])&quot;);
+debug(&quot;&quot;);
+
+debug(&quot;testPrototypeFunction has the following arg list (name, args, init, result [ , expectedArray ])&quot;);
+debug(&quot;&quot;);
+
+debug(&quot;1.0 Single Argument Testing&quot;);
+function keepEven(e, i) {
+    return !(e &amp; 1) || (this.keep ? this.keep === i : false);
+}
+shouldBeTrue(&quot;testPrototypeFunction('findIndex', '(keepEven)', [12, 5, 8, 13, 44], 0)&quot;);
+shouldBeTrue(&quot;testPrototypeFunction('findIndex', '(keepEven)', [11, 13, 17, 13, 22], 4)&quot;);
+shouldBeTrue(&quot;testPrototypeFunction('findIndex', '(keepEven)', [11, 13, 17, 13, 11], -1)&quot;);
+debug(&quot;&quot;);
+
+debug(&quot;2.0 Two Argument Testing&quot;);
+var thisValue = { keep: 3 };
+shouldBeTrue(&quot;testPrototypeFunction('findIndex', '(keepEven, thisValue)', [11, 23, 11, 1, 44], 3)&quot;);
+debug(&quot;&quot;);
+
+debug(&quot;3.0 Array Element Changing&quot;);
+function keepEvenAndChange(e, i, a) {
+    a[a.length - 1 - i] = 5;
+    return !(e &amp; 1);
+}
+shouldBeTrue(&quot;testPrototypeFunction('findIndex', '(keepEvenAndChange)', [11, 15, 3, 12, 44], -1, [5, 5, 5, 5, 5])&quot;);
+debug(&quot;&quot;);
+
+debug(&quot;4.0 Exception Test&quot;);
+function isBigEnoughAndException(element, index, array) {
+    if(index==1) throw &quot;exception from function&quot;;
+    return (element &gt;= 10);
+}
+shouldBeTrue(&quot;testPrototypeFunction('findIndex', '(isBigEnoughAndException)', [12, 15, 10, 13, 44], 0)&quot;);
+shouldThrow(&quot;testPrototypeFunction('findIndex', '(isBigEnoughAndException)', [9, 15, 10, 13, 44], false)&quot;);
+debug(&quot;&quot;);
+
+debug(&quot;5.0 Wrong Type for Callback Test&quot;);
+shouldThrow(&quot;testPrototypeFunction('findIndex', '(8)', [12, 15, 10, 13, 44], false)&quot;);
+shouldThrow(&quot;testPrototypeFunction('findIndex', '(\&quot;wrong\&quot;)', [12, 15, 10, 13, 44], false)&quot;);
+shouldThrow(&quot;testPrototypeFunction('findIndex', '(new Object())', [12, 15, 10, 13, 44], false)&quot;);
+shouldThrow(&quot;testPrototypeFunction('findIndex', '(null)', [12, 15, 10, 13, 44], false)&quot;);
+shouldThrow(&quot;testPrototypeFunction('findIndex', '()', [12, 15, 10, 13, 44], false)&quot;);
+debug(&quot;&quot;);
+finishJSTest();
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoretestsstresstypedarrayforEachjs"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/tests/stress/typedarray-forEach.js (0 => 190367)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/tests/stress/typedarray-forEach.js                                (rev 0)
+++ trunk/Source/JavaScriptCore/tests/stress/typedarray-forEach.js        2015-09-30 21:00:42 UTC (rev 190367)
</span><span class="lines">@@ -0,0 +1,91 @@
</span><ins>+load(&quot;./resources/typedarray-test-helper-functions.js&quot;);
+description(
+&quot;This test checks the behavior of the TypedArray.prototype.forEach function&quot;
+);
+
+shouldBe(&quot;Int32Array.prototype.forEach.length&quot;, &quot;1&quot;);
+shouldBe(&quot;Int32Array.prototype.forEach.name&quot;, &quot;'forEach'&quot;);
+shouldBeTrue(&quot;isSameFunctionForEachTypedArrayPrototype('forEach')&quot;);
+shouldBeTrue(&quot;testPrototypeReceivesArray('forEach', [undefined, this, { }, [ ], true, ''])&quot;);
+debug(&quot;&quot;);
+
+var passed = true;
+var thisPassed = true;
+var typedArray;
+function createChecker(expected, callback, thisValue) {
+    function checkCorrect(array) {
+        let list = []
+        function accumulate(e, i, a) {
+            list.push(callback.call(this, e, i, a));
+        }
+
+        typedArray = array;
+        array.forEach(accumulate, thisValue);
+
+        if (list.length !== expected.length) {
+            debug(&quot;forEach did not work correctly, computed array: &quot; + list + &quot; expected array: &quot; + expected);
+            passed = false;
+        }
+
+        for (let i = 0; i &lt; list.length; ++i)
+            if (list[i] !== expected[i]) {
+                debug(&quot;forEach did not work correctly, computed array: &quot; + list + &quot; expected array: &quot; + expected);
+                passed = false;
+            }
+    }
+
+    return checkCorrect;
+}
+
+function foo(e, i) {
+    if (this.value !== 3)
+        thisPassed = false;
+    return e;
+}
+
+
+debug(&quot;1.0 Single Argument Testing&quot;);
+
+forEachTypedArray(typedArrays, createChecker([1, 2, 3, 4, 5], foo, undefined), [1, 2, 3, 4, 5]);
+shouldBeTrue(&quot;passed&quot;);
+debug(&quot;&quot;);
+
+debug(&quot;2.0 Two Argument Testing&quot;);
+passed = true;
+thisPassed = true;
+
+forEachTypedArray(typedArrays, createChecker([1, 2, 3, 4, 5], foo, { value: 3 }), [1, 2, 3, 4, 5]);
+shouldBeTrue(&quot;passed &amp;&amp; thisPassed&quot;);
+
+passed = true;
+thisPassed = true;
+forEachTypedArray(typedArrays, createChecker([1, 2, 3, 4, 5], foo, { value: 2 }), [1, 2, 3, 4, 5]);
+shouldBeTrue(&quot;passed &amp;&amp; !thisPassed&quot;);
+debug(&quot;&quot;);
+
+debug(&quot;3.0 Array Element Changing&quot;);
+function changeArray(e, i, a) {
+    a[a.length - 1 - i] = 5;
+    return e;
+}
+
+forEachTypedArray(typedArrays, createChecker([11, 12, 13, 5, 5], changeArray), [11, 12, 13, 14, 15]);
+shouldBeTrue(&quot;passed &amp;&amp; hasSameValues('array did not mutate correctly', typedArray, [5, 5, 5, 5, 5])&quot;);
+debug(&quot;&quot;);
+
+debug(&quot;4.0 Exception Test&quot;);
+function isBigEnoughAndException(element, index, array) {
+    if(index==1) throw &quot;exception from function&quot;;
+    return (element);
+}
+shouldThrow(&quot;testPrototypeFunction('forEach', '(isBigEnoughAndException)', [9, 15, 10, 13, 44], false)&quot;);
+debug(&quot;&quot;);
+
+debug(&quot;5.0 Wrong Type for Callback Test&quot;);
+shouldThrow(&quot;testPrototypeFunction('forEach', '(8)', [12, 15, 10, 13, 44], false)&quot;);
+shouldThrow(&quot;testPrototypeFunction('forEach', '(\&quot;wrong\&quot;)', [12, 15, 10, 13, 44], false)&quot;);
+shouldThrow(&quot;testPrototypeFunction('forEach', '(new Object())', [12, 15, 10, 13, 44], false)&quot;);
+shouldThrow(&quot;testPrototypeFunction('forEach', '(null)', [12, 15, 10, 13, 44], false)&quot;);
+shouldThrow(&quot;testPrototypeFunction('forEach', '()', [12, 15, 10, 13, 44], false)&quot;);
+debug(&quot;&quot;);
+finishJSTest();
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoretestsstresstypedarrayindexOfjs"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/tests/stress/typedarray-indexOf.js (0 => 190367)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/tests/stress/typedarray-indexOf.js                                (rev 0)
+++ trunk/Source/JavaScriptCore/tests/stress/typedarray-indexOf.js        2015-09-30 21:00:42 UTC (rev 190367)
</span><span class="lines">@@ -0,0 +1,31 @@
</span><ins>+load(&quot;./resources/typedarray-test-helper-functions.js&quot;);
+description(
+&quot;This test checks the behavior of the TypedArray.prototype.indexOf function&quot;
+);
+
+shouldBe(&quot;Int32Array.prototype.indexOf.length&quot;, &quot;1&quot;);
+shouldBe(&quot;Int32Array.prototype.indexOf.name&quot;, &quot;'indexOf'&quot;);
+shouldBeTrue(&quot;isSameFunctionForEachTypedArrayPrototype('indexOf')&quot;);
+shouldBeTrue(&quot;testPrototypeReceivesArray('indexOf', [undefined, this, { }, [ ], true, ''])&quot;);
+debug(&quot;&quot;);
+
+debug(&quot;testPrototypeFunction has the following arg list (name, args, init, result [ , expectedArray ])&quot;);
+debug(&quot;&quot;);
+
+function keepEven(e, i) {
+    return !(e &amp; 1) || (this.keep ? this.keep === i : false);
+}
+
+var array = [2, 5, 9, 2]
+
+shouldBeTrue(&quot;testPrototypeFunction('indexOf', '(2, -500)', array, 0)&quot;);
+shouldBeTrue(&quot;testPrototypeFunction('indexOf', '(9, 500)', array, -1)&quot;);
+shouldBeTrue(&quot;testPrototypeFunction('indexOf', '(2)', array, 0)&quot;);
+shouldBeTrue(&quot;testPrototypeFunction('indexOf', '(7)', array, -1)&quot;);
+shouldBeTrue(&quot;testPrototypeFunction('indexOf', '(2, 3)', array, 3)&quot;);
+shouldBeTrue(&quot;testPrototypeFunction('indexOf', '(2, 2)', array, 3)&quot;);
+shouldBeTrue(&quot;testPrototypeFunction('indexOf', '(2, 0)', array, 0)&quot;);
+shouldBeTrue(&quot;testPrototypeFunction('indexOf', '(2, -1)', array, 3)&quot;);
+shouldBeTrue(&quot;testPrototypeFunction('indexOf', '(2, -2)', array, 3)&quot;);
+debug(&quot;&quot;);
+finishJSTest();
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoretestsstresstypedarraylastIndexOfjs"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/tests/stress/typedarray-lastIndexOf.js (0 => 190367)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/tests/stress/typedarray-lastIndexOf.js                                (rev 0)
+++ trunk/Source/JavaScriptCore/tests/stress/typedarray-lastIndexOf.js        2015-09-30 21:00:42 UTC (rev 190367)
</span><span class="lines">@@ -0,0 +1,28 @@
</span><ins>+load(&quot;./resources/typedarray-test-helper-functions.js&quot;);
+description(
+&quot;This test checks the behavior of the TypedArray.prototype.lastIndexOf function&quot;
+);
+
+shouldBe(&quot;Int32Array.prototype.lastIndexOf.length&quot;, &quot;1&quot;);
+shouldBe(&quot;Int32Array.prototype.lastIndexOf.name&quot;, &quot;'lastIndexOf'&quot;);
+shouldBeTrue(&quot;isSameFunctionForEachTypedArrayPrototype('lastIndexOf')&quot;);
+shouldBeTrue(&quot;testPrototypeReceivesArray('lastIndexOf', [undefined, this, { }, [ ], true, ''])&quot;);
+debug(&quot;&quot;);
+
+debug(&quot;testPrototypeFunction has the following arg list (name, args, init, result [ , expectedArray ])&quot;);
+debug(&quot;&quot;);
+
+var array = [2, 5, 9, 2]
+
+shouldBeTrue(&quot;testPrototypeFunction('lastIndexOf', '(2, -500)', array, -1)&quot;);
+shouldBeTrue(&quot;testPrototypeFunction('lastIndexOf', '(9, 500)', array, 2)&quot;);
+shouldBeTrue(&quot;testPrototypeFunction('lastIndexOf', '(2)', array, 3)&quot;);
+shouldBeTrue(&quot;testPrototypeFunction('lastIndexOf', '(5)', array, 1)&quot;);
+shouldBeTrue(&quot;testPrototypeFunction('lastIndexOf', '(7)', array, -1)&quot;);
+shouldBeTrue(&quot;testPrototypeFunction('lastIndexOf', '(2, 3)', array, 3)&quot;);
+shouldBeTrue(&quot;testPrototypeFunction('lastIndexOf', '(2, 2)', array, 0)&quot;);
+shouldBeTrue(&quot;testPrototypeFunction('lastIndexOf', '(2, 0)', array, 0)&quot;);
+shouldBeTrue(&quot;testPrototypeFunction('lastIndexOf', '(2, -1)', array, 3)&quot;);
+shouldBeTrue(&quot;testPrototypeFunction('lastIndexOf', '(2, -2)', array, 0)&quot;);
+debug(&quot;&quot;);
+finishJSTest();
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoretestsstresstypedarraymapjs"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/tests/stress/typedarray-map.js (0 => 190367)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/tests/stress/typedarray-map.js                                (rev 0)
+++ trunk/Source/JavaScriptCore/tests/stress/typedarray-map.js        2015-09-30 21:00:42 UTC (rev 190367)
</span><span class="lines">@@ -0,0 +1,51 @@
</span><ins>+load(&quot;./resources/typedarray-test-helper-functions.js&quot;);
+description(
+&quot;This test checks the behavior of the TypedArray.prototype.map function&quot;
+);
+
+shouldBe(&quot;Int32Array.prototype.map.length&quot;, &quot;1&quot;);
+shouldBe(&quot;Int32Array.prototype.map.name&quot;, &quot;'map'&quot;);
+shouldBeTrue(&quot;isSameFunctionForEachTypedArrayPrototype('map')&quot;);
+shouldBeTrue(&quot;testPrototypeReceivesArray('map', [undefined, this, { }, [ ], true, ''])&quot;);
+debug(&quot;&quot;);
+
+debug(&quot;testPrototypeFunction has the following arg list (name, args, init, result [ , expectedArray ])&quot;);
+debug(&quot;&quot;);
+
+debug(&quot;1.0 Single Argument Testing&quot;);
+function even(e, i) {
+    return !(e &amp; 1) || (this.change ? this.change.indexOf(i) &gt;= 0 : false);
+}
+shouldBeTrue(&quot;testPrototypeFunction('map', '(even)', [12, 5, 8, 13, 44], [1, 0, 1, 0, 1], [12, 5, 8, 13, 44])&quot;);
+shouldBeTrue(&quot;testPrototypeFunction('map', '(even)', [11, 54, 18, 13, 1], [0, 1, 1, 0, 0])&quot;);
+debug(&quot;&quot;);
+
+debug(&quot;2.0 Two Argument Testing&quot;);
+var thisValue = { change: [1, 3] };
+shouldBeTrue(&quot;testPrototypeFunction('map', '(even, thisValue)', [12, 23, 11, 1, 45], [1, 1, 0, 1, 0])&quot;);
+debug(&quot;&quot;);
+
+debug(&quot;3.0 Array Element Changing&quot;);
+function evenAndChange(e, i, a) {
+    a[a.length - 1 - i] = 5;
+    return !(e &amp; 1);
+}
+shouldBeTrue(&quot;testPrototypeFunction('map', '(evenAndChange)', [12, 15, 2, 13, 44], [1, 0, 1, 0, 0], [5, 5, 5, 5, 5])&quot;);
+debug(&quot;&quot;);
+
+debug(&quot;4.0 Exception Test&quot;);
+function isBigEnoughAndException(element, index, array) {
+    if(index==1) throw &quot;exception from function&quot;;
+    return (element &gt;= 10);
+}
+shouldThrow(&quot;testPrototypeFunction('map', '(isBigEnoughAndException)', [12, 15, 10, 13, 44], false)&quot;);
+debug(&quot;&quot;);
+
+debug(&quot;5.0 Wrong Type for Callback Test&quot;);
+shouldThrow(&quot;testPrototypeFunction('map', '(8)', [12, 15, 10, 13, 44], false)&quot;);
+shouldThrow(&quot;testPrototypeFunction('map', '(\&quot;wrong\&quot;)', [12, 15, 10, 13, 44], false)&quot;);
+shouldThrow(&quot;testPrototypeFunction('map', '(new Object())', [12, 15, 10, 13, 44], false)&quot;);
+shouldThrow(&quot;testPrototypeFunction('map', '(null)', [12, 15, 10, 13, 44], false)&quot;);
+shouldThrow(&quot;testPrototypeFunction('map', '()', [12, 15, 10, 13, 44], false)&quot;);
+debug(&quot;&quot;);
+finishJSTest();
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoretestsstresstypedarrayreducejs"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/tests/stress/typedarray-reduce.js (0 => 190367)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/tests/stress/typedarray-reduce.js                                (rev 0)
+++ trunk/Source/JavaScriptCore/tests/stress/typedarray-reduce.js        2015-09-30 21:00:42 UTC (rev 190367)
</span><span class="lines">@@ -0,0 +1,58 @@
</span><ins>+load(&quot;./resources/typedarray-test-helper-functions.js&quot;);
+description(
+&quot;This test checks the behavior of the TypedArray.prototype.reduce function&quot;
+);
+
+shouldBe(&quot;Int32Array.prototype.reduce.length&quot;, &quot;1&quot;);
+shouldBe(&quot;Int32Array.prototype.reduce.name&quot;, &quot;'reduce'&quot;);
+shouldBeTrue(&quot;isSameFunctionForEachTypedArrayPrototype('reduce')&quot;);
+shouldBeTrue(&quot;testPrototypeReceivesArray('reduce', [undefined, this, { }, [ ], true, ''])&quot;);
+debug(&quot;&quot;);
+
+debug(&quot;testPrototypeFunction has the following arg list (name, args, init, result [ , expectedArray ])&quot;);
+debug(&quot;&quot;);
+
+debug(&quot;1.0 Single Argument Testing&quot;);
+function createArray(acc, e, i, a) {
+    if (typeof acc !== &quot;object&quot;)
+        acc = [acc];
+    acc.push(e);
+    return acc;
+}
+
+function sum(acc, e, i, a) { return acc + e; }
+
+shouldBeTrue(&quot;testPrototypeFunction('reduce', '(createArray)', [12, 5, 8, 13, 44], [12, 5, 8, 13, 44], [12, 5, 8, 13, 44])&quot;);
+shouldBeTrue(&quot;testPrototypeFunction('reduce', '(sum)', [1, 2, 3, 4, 5], 15)&quot;);
+debug(&quot;&quot;);
+
+debug(&quot;2.0 Two Argument Testing&quot;);
+
+shouldBeTrue(&quot;testPrototypeFunction('reduce', '(createArray, [1])', [12, 23, 11, 1, 45], [1, 12, 23, 11, 1, 45], [12, 23, 11, 1, 45])&quot;);
+debug(&quot;&quot;);
+
+debug(&quot;3.0 Array Element Changing&quot;);
+function createArrayAndChange(acc, e, i, a) {
+    a[a.length - 1 - i] = 5;
+    acc.push(e);
+    return acc;
+}
+shouldBeTrue(&quot;testPrototypeFunction('reduce', '(createArrayAndChange, [])', [12, 15, 2, 13, 44], [12, 15, 2, 5, 5], [5, 5, 5, 5, 5])&quot;);
+debug(&quot;&quot;);
+
+debug(&quot;4.0 Exception Test&quot;);
+function isBigEnoughAndException(acc, element, index, array) {
+    if(index==1) throw &quot;exception from function&quot;;
+    return (element &gt;= 10);
+}
+shouldThrow(&quot;testPrototypeFunction('reduce', '(isBigEnoughAndException)', [12, 15, 10, 13, 44], false)&quot;);
+debug(&quot;&quot;);
+
+debug(&quot;5.0 Wrong Type for Callback Test&quot;);
+shouldThrow(&quot;testPrototypeFunction('reduce', '(8)', [12, 15, 10, 13, 44], false)&quot;);
+shouldThrow(&quot;testPrototypeFunction('reduce', '(\&quot;wrong\&quot;)', [12, 15, 10, 13, 44], false)&quot;);
+shouldThrow(&quot;testPrototypeFunction('reduce', '(new Object())', [12, 15, 10, 13, 44], false)&quot;);
+shouldThrow(&quot;testPrototypeFunction('reduce', '(null)', [12, 15, 10, 13, 44], false)&quot;);
+shouldThrow(&quot;testPrototypeFunction('reduce', '()', [12, 15, 10, 13, 44], false)&quot;);
+debug(&quot;&quot;);
+finishJSTest();
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoretestsstresstypedarrayreduceRightjs"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/tests/stress/typedarray-reduceRight.js (0 => 190367)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/tests/stress/typedarray-reduceRight.js                                (rev 0)
+++ trunk/Source/JavaScriptCore/tests/stress/typedarray-reduceRight.js        2015-09-30 21:00:42 UTC (rev 190367)
</span><span class="lines">@@ -0,0 +1,58 @@
</span><ins>+load(&quot;./resources/typedarray-test-helper-functions.js&quot;);
+description(
+&quot;This test checks the behavior of the TypedArray.prototype.reduceRight function&quot;
+);
+
+shouldBe(&quot;Int32Array.prototype.reduceRight.length&quot;, &quot;1&quot;);
+shouldBe(&quot;Int32Array.prototype.reduceRight.name&quot;, &quot;'reduceRight'&quot;);
+shouldBeTrue(&quot;isSameFunctionForEachTypedArrayPrototype('reduceRight')&quot;);
+shouldBeTrue(&quot;testPrototypeReceivesArray('reduceRight', [undefined, this, { }, [ ], true, ''])&quot;);
+debug(&quot;&quot;);
+
+debug(&quot;testPrototypeFunction has the following arg list (name, args, init, result [ , expectedArray ])&quot;);
+debug(&quot;&quot;);
+
+debug(&quot;1.0 Single Argument Testing&quot;);
+function createArray(acc, e, i, a) {
+    if (typeof acc !== &quot;object&quot;)
+        acc = [acc];
+    acc.push(e);
+    return acc;
+}
+
+function sum(acc, e, i, a) { return acc + e; }
+
+shouldBeTrue(&quot;testPrototypeFunction('reduceRight', '(createArray)', [12, 5, 8, 13, 44], [12, 5, 8, 13, 44].reverse(), [12, 5, 8, 13, 44])&quot;);
+shouldBeTrue(&quot;testPrototypeFunction('reduceRight', '(sum)', [1, 2, 3, 4, 5], 15)&quot;);
+debug(&quot;&quot;);
+
+debug(&quot;2.0 Two Argument Testing&quot;);
+
+shouldBeTrue(&quot;testPrototypeFunction('reduceRight', '(createArray, [1])', [12, 23, 11, 1, 45], [1, 45, 1, 11, 23, 12], [12, 23, 11, 1, 45])&quot;);
+debug(&quot;&quot;);
+
+debug(&quot;3.0 Array Element Changing&quot;);
+function createArrayAndChange(acc, e, i, a) {
+    a[a.length - 1 - i] = 5;
+    acc.push(e);
+    return acc;
+}
+shouldBeTrue(&quot;testPrototypeFunction('reduceRight', '(createArrayAndChange, [])', [12, 15, 2, 13, 44], [44, 13, 2, 5, 5], [5, 5, 5, 5, 5])&quot;);
+debug(&quot;&quot;);
+
+debug(&quot;4.0 Exception Test&quot;);
+function isBigEnoughAndException(acc, element, index, array) {
+    if(index==1) throw &quot;exception from function&quot;;
+    return (element &gt;= 10);
+}
+shouldThrow(&quot;testPrototypeFunction('reduceRight', '(isBigEnoughAndException)', [12, 15, 10, 13, 44], false)&quot;);
+debug(&quot;&quot;);
+
+debug(&quot;5.0 Wrong Type for Callback Test&quot;);
+shouldThrow(&quot;testPrototypeFunction('reduceRight', '(8)', [12, 15, 10, 13, 44], false)&quot;);
+shouldThrow(&quot;testPrototypeFunction('reduceRight', '(\&quot;wrong\&quot;)', [12, 15, 10, 13, 44], false)&quot;);
+shouldThrow(&quot;testPrototypeFunction('reduceRight', '(new Object())', [12, 15, 10, 13, 44], false)&quot;);
+shouldThrow(&quot;testPrototypeFunction('reduceRight', '(null)', [12, 15, 10, 13, 44], false)&quot;);
+shouldThrow(&quot;testPrototypeFunction('reduceRight', '()', [12, 15, 10, 13, 44], false)&quot;);
+debug(&quot;&quot;);
+finishJSTest();
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoretestsstresstypedarrayslicejs"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/tests/stress/typedarray-slice.js (0 => 190367)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/tests/stress/typedarray-slice.js                                (rev 0)
+++ trunk/Source/JavaScriptCore/tests/stress/typedarray-slice.js        2015-09-30 21:00:42 UTC (rev 190367)
</span><span class="lines">@@ -0,0 +1,44 @@
</span><ins>+load(&quot;./resources/typedarray-test-helper-functions.js&quot;);
+description(
+&quot;This test checks the behavior of the TypedArray.prototype.slice function&quot;
+);
+
+shouldBe(&quot;Int32Array.prototype.slice.length&quot;, &quot;2&quot;);
+shouldBe(&quot;Int32Array.prototype.slice.name&quot;, &quot;'slice'&quot;);
+shouldBeTrue(&quot;isSameFunctionForEachTypedArrayPrototype('slice')&quot;);
+shouldBeTrue(&quot;testPrototypeReceivesArray('slice', [undefined, this, { }, [ ], true, ''])&quot;);
+debug(&quot;&quot;);
+
+debug(&quot;testPrototypeFunction has the following arg list (name, args, init, result [ , expectedArray ])&quot;);
+debug(&quot;&quot;);
+
+debug(&quot;1.0 Test Basic Functionality&quot;);
+shouldBeTrue(&quot;testPrototypeFunction('slice', '(2, 3)', [12, 5, 8, 13, 44], [8], [12, 5, 8, 13, 44])&quot;);
+shouldBeTrue(&quot;testPrototypeFunction('slice', '(5, 5)', [12, 5, 8, 13, 44], [])&quot;);
+shouldBeTrue(&quot;testPrototypeFunction('slice', '(0, 5)', [12, 5, 8, 13, 44], [12, 5, 8, 13, 44])&quot;);
+shouldBeTrue(&quot;testPrototypeFunction('slice', '(0, -5)', [12, 5, 8, 13, 44], [])&quot;);
+shouldBeTrue(&quot;testPrototypeFunction('slice', '(-3, -2)', [12, 5, 8, 13, 44], [8])&quot;);
+shouldBeTrue(&quot;testPrototypeFunction('slice', '(4, 2)', [12, 5, 8, 13, 44], [])&quot;);
+shouldBeTrue(&quot;testPrototypeFunction('slice', '(-50, 50)', [12, 5, 8, 13, 44], [12, 5, 8, 13, 44])&quot;);
+debug(&quot;&quot;);
+
+debug(&quot;2.0 Preserve Underlying bits&quot;);
+
+var intView = new Int32Array(5);
+intView[0] = -1;
+var floatView = new Float32Array(intView.buffer);
+floatView = floatView.slice(0,1);
+intView = new Int32Array(floatView.buffer);
+
+shouldBe(&quot;intView[0]&quot;, &quot;-1&quot;);
+debug(&quot;&quot;);
+
+debug(&quot;3.0 Creates New Buffer&quot;);
+
+var intView = new Int32Array(1)
+var newView = intView.slice(0,1);
+newView[0] = 1;
+
+shouldBe(&quot;intView[0]&quot;, &quot;0&quot;);
+debug(&quot;&quot;);
+finishJSTest();
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoretestsstresstypedarraysomejs"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/tests/stress/typedarray-some.js (0 => 190367)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/tests/stress/typedarray-some.js                                (rev 0)
+++ trunk/Source/JavaScriptCore/tests/stress/typedarray-some.js        2015-09-30 21:00:42 UTC (rev 190367)
</span><span class="lines">@@ -0,0 +1,56 @@
</span><ins>+load(&quot;./resources/typedarray-test-helper-functions.js&quot;);
+description(
+&quot;This test checks the behavior of the TypedArray.prototype.some function&quot;
+);
+
+shouldBe(&quot;Int32Array.prototype.some.length&quot;, &quot;1&quot;);
+shouldBe(&quot;Int32Array.prototype.some.name&quot;, &quot;'some'&quot;);
+shouldBeTrue(&quot;isSameFunctionForEachTypedArrayPrototype('some')&quot;);
+shouldBeTrue(&quot;testPrototypeReceivesArray('some', [undefined, this, { }, [ ], true, ''])&quot;);
+debug(&quot;&quot;);
+
+debug(&quot;testPrototypeFunction has the following arg list (name, args, init, result [ , expectedArray ])&quot;);
+debug(&quot;&quot;);
+
+debug(&quot;1.0 Single Argument Testing&quot;);
+function isBigEnough(element, index, array) {
+    if (this.value)
+        return element &gt;= this.value;
+    return element &gt;= 10;
+}
+shouldBeTrue(&quot;testPrototypeFunction('some', '(isBigEnough)', [12, 5, 8, 13, 44], true, [12, 5, 8, 13, 44])&quot;);
+shouldBeTrue(&quot;testPrototypeFunction('some', '(isBigEnough)', [2, 4, 8, 3, 4], false)&quot;);
+debug(&quot;&quot;);
+
+debug(&quot;2.0 Two Argument Testing&quot;);
+var thisValue = { value: 11 };
+shouldBeTrue(&quot;testPrototypeFunction('some', '(isBigEnough, thisValue)', [2, 5, 10, 3, 4], false)&quot;);
+shouldBeTrue(&quot;testPrototypeFunction('some', '(isBigEnough, thisValue)', [12, 54, 82, 13, 44], true)&quot;);
+debug(&quot;&quot;);
+
+debug(&quot;3.0 Array Element Changing&quot;);
+function isBigEnoughAndChange(element, index, array) {
+    array[array.length - 1 - index] = 5;
+    return (element &gt;= 10);
+}
+shouldBeTrue(&quot;testPrototypeFunction('some', '(isBigEnoughAndChange)', [2, 5, 1, 13, 44], false, [5, 5, 5, 5, 5])&quot;);
+shouldBeTrue(&quot;testPrototypeFunction('some', '(isBigEnoughAndChange)', [12, 15, 10, 13, 44], true, [12, 15, 10, 13, 5])&quot;);
+debug(&quot;&quot;);
+
+debug(&quot;4.0 Exception Test&quot;);
+function isBigEnoughAndException(element, index, array) {
+    if(index==1) throw &quot;exception from function&quot;;
+    return (element &gt;= 10);
+}
+shouldBeTrue(&quot;testPrototypeFunction('some', '(isBigEnoughAndException)', [12, 15, 10, 13, 44], true)&quot;);
+shouldThrow(&quot;testPrototypeFunction('some', '(isBigEnoughAndException)', [1, 15, 10, 13, 44], false)&quot;);
+debug(&quot;&quot;);
+
+debug(&quot;5.0 Wrong Type for Callback Test&quot;);
+shouldThrow(&quot;testPrototypeFunction('some', '(8)', [12, 15, 10, 13, 44], false)&quot;);
+shouldThrow(&quot;testPrototypeFunction('some', '(\&quot;wrong\&quot;)', [12, 15, 10, 13, 44], false)&quot;);
+shouldThrow(&quot;testPrototypeFunction('some', '(new Object())', [12, 15, 10, 13, 44], false)&quot;);
+shouldThrow(&quot;testPrototypeFunction('some', '(null)', [12, 15, 10, 13, 44], false)&quot;);
+shouldThrow(&quot;testPrototypeFunction('some', '()', [12, 15, 10, 13, 44], false)&quot;);
+debug(&quot;&quot;);
+finishJSTest();
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoretestsstresstypedarraysortjs"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/tests/stress/typedarray-sort.js (0 => 190367)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/tests/stress/typedarray-sort.js                                (rev 0)
+++ trunk/Source/JavaScriptCore/tests/stress/typedarray-sort.js        2015-09-30 21:00:42 UTC (rev 190367)
</span><span class="lines">@@ -0,0 +1,57 @@
</span><ins>+load(&quot;./resources/typedarray-test-helper-functions.js&quot;);
+description(
+&quot;This test checks the behavior of the TypedArray.prototype.sort function&quot;
+);
+
+shouldBe(&quot;Int32Array.prototype.sort.length&quot;, &quot;1&quot;);
+shouldBe(&quot;Int32Array.prototype.sort.name&quot;, &quot;'sort'&quot;);
+shouldBeTrue(&quot;isSameFunctionForEachTypedArrayPrototype('sort')&quot;);
+shouldBeTrue(&quot;testPrototypeReceivesArray('sort', [undefined, this, { }, [ ], true, ''])&quot;);
+debug(&quot;&quot;);
+
+debug(&quot;testPrototypeFunction has the following arg list (name, args, init, result [ , expectedArray ])&quot;);
+debug(&quot;&quot;);
+
+debug(&quot;1.0 No Argument Testing&quot;);
+shouldBeTrue(&quot;testPrototypeFunction('sort', '()', [12, 5, 8, 13, 44], [5, 8, 12, 13, 44], [5, 8, 12, 13, 44])&quot;);
+shouldBeTrue(&quot;testPrototypeFunction('sort', '()', [2, 4, 8, 3, 4], [2, 3, 4, 4, 8])&quot;);
+debug(&quot;&quot;);
+
+debug(&quot;1.1 Signed Numbers&quot;);
+shouldBeTrue(&quot;testPrototypeFunctionOnSigned('sort', '()', [12, -5, 8, -13, 44], [-13, -5, 8, 12, 44])&quot;);
+debug(&quot;&quot;);
+
+debug(&quot;1.2 Float Numbers&quot;);
+shouldBeTrue(&quot;testPrototypeFunctionOnFloat('sort', '()', [12, -5, 0, -0, -13, 44], [-13, -5, -0, 0, 12, 44])&quot;);
+
+debug(&quot;1.3 Negative NaNs&quot;);
+var buffer = new ArrayBuffer(8);
+var intView = new Int32Array(buffer);
+var floatView = new Float32Array(buffer);
+intView[0] = -1;
+
+floatView.sort();
+shouldBeTrue(&quot;Object.is(floatView[0],0) &amp;&amp; Object.is(floatView[1], NaN)&quot;);
+debug(&quot;&quot;);
+
+debug(&quot;2.0 Custom Function Testing&quot;);
+function sortBackwards(a, b) { return b - a; }
+shouldBeTrue(&quot;testPrototypeFunction('sort', '(sortBackwards)', [2, 5, 10, 3, 4], [10, 5, 4, 3, 2])&quot;);
+debug(&quot;&quot;);
+
+debug(&quot;3.0 Exception Test&quot;);
+var count = 0;
+function compareException(a, b) {
+    if(count++ === 4) throw &quot;exception from function&quot;;
+    return a &lt; b;
+}
+shouldThrow(&quot;testPrototypeFunction('sort', '(compareException)', [12, 15, 10, 13, 44], true)&quot;);
+debug(&quot;&quot;);
+
+debug(&quot;4.0 Wrong Type for Callback Test&quot;);
+shouldBeTrue(&quot;testPrototypeFunction('sort', '(8)', [12, 15, 10, 13, 44], [10, 12, 13, 15, 44])&quot;);
+shouldBeTrue(&quot;testPrototypeFunction('sort', '(\&quot;wrong\&quot;)', [12, 15, 10, 13, 44], [10, 12, 13, 15, 44])&quot;);
+shouldBeTrue(&quot;testPrototypeFunction('sort', '(new Object())', [12, 15, 10, 13, 44], [10, 12, 13, 15, 44])&quot;);
+shouldBeTrue(&quot;testPrototypeFunction('sort', '(null)', [12, 15, 10, 13, 44], [10, 12, 13, 15, 44])&quot;);
+debug(&quot;&quot;);
+finishJSTest();
</ins></span></pre>
</div>
</div>

</body>
</html>