<!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>[189064] 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/189064">189064</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2015-08-27 15:57:07 -0700 (Thu, 27 Aug 2015)</dd>
</dl>

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

Patch by Keith Miller &lt;keith_miller@apple.com&gt; on 2015-08-27
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.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::sortFloat):
(JSC::JSGenericTypedArrayView::toAdaptorNativeFromValue):
(JSC::JSGenericTypedArrayView::setRangeToValue):
(JSC::JSGenericTypedArrayView::sort):
* 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.

LayoutTests:

Added tests for the TypedArray.prototype functions.
All the tests use the typedarray-test-helper-function.js
to run the test on each TypedArray.

* fast/canvas/webgl/type-conversion-test-expected.txt:
* js/script-tests/typedarray-copyWithin.js: Added.
* js/script-tests/typedarray-every.js: Added.
(isBigEnough):
(isBigEnoughAndChange):
(isBigEnoughAndException):
* js/script-tests/typedarray-fill.js: Added.
* js/script-tests/typedarray-filter.js: Added.
(keepEven):
(keepEvenAndChange):
(isBigEnoughAndException):
* js/script-tests/typedarray-find.js: Added.
(keepEven):
(keepEvenAndChange):
(isBigEnoughAndException):
* js/script-tests/typedarray-findIndex.js: Added.
(keepEven):
(keepEvenAndChange):
(isBigEnoughAndException):
* js/script-tests/typedarray-forEach.js: Added.
(.checkCorrect.let.list):
(.checkCorrect):
(createChecker):
(foo):
(changeArray):
(isBigEnoughAndException):
* js/script-tests/typedarray-indexOf.js: Added.
(keepEven):
* js/script-tests/typedarray-lastIndexOf.js: Added.
* js/script-tests/typedarray-map.js: Added.
(even):
(evenAndChange):
(isBigEnoughAndException):
* js/script-tests/typedarray-reduce.js: Added.
(createArray):
(sum):
(createArrayAndChange):
(isBigEnoughAndException):
* js/script-tests/typedarray-reduceRight.js: Added.
(createArray):
(sum):
(createArrayAndChange):
(isBigEnoughAndException):
* js/script-tests/typedarray-slice.js: Added.
* js/script-tests/typedarray-some.js: Added.
(isBigEnough):
(isBigEnoughAndChange):
(isBigEnoughAndException):
* js/script-tests/typedarray-sort.js: Added.
(sortBackwards):
(compareException):
* js/script-tests/typedarray-test-helper-functions.js: Added.
(forEachTypedArray):
(isSameFunctionForEachTypedArrayPrototype.eq):
(isSameFunctionForEachTypedArrayPrototype):
(hasSameValues):
(.foo):
(testPrototypeFunctionHelper):
(testPrototypeFunctionOnSigned):
(testPrototypeFunctionOnFloat):
(testPrototypeFunction):
* js/typedarray-copyWithin-expected.txt: Added.
* js/typedarray-copyWithin.html: Added.
* js/typedarray-every-expected.txt: Added.
* js/typedarray-every.html: Added.
* js/typedarray-fill-expected.txt: Added.
* js/typedarray-fill.html: Added.
* js/typedarray-filter-expected.txt: Added.
* js/typedarray-filter.html: Added.
* js/typedarray-find-expected.txt: Added.
* js/typedarray-find.html: Added.
* js/typedarray-findIndex-expected.txt: Added.
* js/typedarray-findIndex.html: Added.
* js/typedarray-forEach-expected.txt: Added.
* js/typedarray-forEach.html: Added.
* js/typedarray-indexOf-expected.txt: Added.
* js/typedarray-indexOf.html: Added.
* js/typedarray-lastIndexOf-expected.txt: Added.
* js/typedarray-lastIndexOf.html: Added.
* js/typedarray-map-expected.txt: Added.
* js/typedarray-map.html: Added.
* js/typedarray-reduce-expected.txt: Added.
* js/typedarray-reduce.html: Added.
* js/typedarray-reduceRight-expected.txt: Added.
* js/typedarray-reduceRight.html: Added.
* js/typedarray-slice-expected.txt: Added.
* js/typedarray-slice.html: Added.
* js/typedarray-some-expected.txt: Added.
* js/typedarray-some.html: Added.
* js/typedarray-sort-expected.txt: Added.
* js/typedarray-sort.html: Added.</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="#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>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsjsscriptteststypedarraycopyWithinjs">trunk/LayoutTests/js/script-tests/typedarray-copyWithin.js</a></li>
<li><a href="#trunkLayoutTestsjsscriptteststypedarrayeveryjs">trunk/LayoutTests/js/script-tests/typedarray-every.js</a></li>
<li><a href="#trunkLayoutTestsjsscriptteststypedarrayfilljs">trunk/LayoutTests/js/script-tests/typedarray-fill.js</a></li>
<li><a href="#trunkLayoutTestsjsscriptteststypedarrayfilterjs">trunk/LayoutTests/js/script-tests/typedarray-filter.js</a></li>
<li><a href="#trunkLayoutTestsjsscriptteststypedarrayfindjs">trunk/LayoutTests/js/script-tests/typedarray-find.js</a></li>
<li><a href="#trunkLayoutTestsjsscriptteststypedarrayfindIndexjs">trunk/LayoutTests/js/script-tests/typedarray-findIndex.js</a></li>
<li><a href="#trunkLayoutTestsjsscriptteststypedarrayforEachjs">trunk/LayoutTests/js/script-tests/typedarray-forEach.js</a></li>
<li><a href="#trunkLayoutTestsjsscriptteststypedarrayindexOfjs">trunk/LayoutTests/js/script-tests/typedarray-indexOf.js</a></li>
<li><a href="#trunkLayoutTestsjsscriptteststypedarraylastIndexOfjs">trunk/LayoutTests/js/script-tests/typedarray-lastIndexOf.js</a></li>
<li><a href="#trunkLayoutTestsjsscriptteststypedarraymapjs">trunk/LayoutTests/js/script-tests/typedarray-map.js</a></li>
<li><a href="#trunkLayoutTestsjsscriptteststypedarrayreducejs">trunk/LayoutTests/js/script-tests/typedarray-reduce.js</a></li>
<li><a href="#trunkLayoutTestsjsscriptteststypedarrayreduceRightjs">trunk/LayoutTests/js/script-tests/typedarray-reduceRight.js</a></li>
<li><a href="#trunkLayoutTestsjsscriptteststypedarrayslicejs">trunk/LayoutTests/js/script-tests/typedarray-slice.js</a></li>
<li><a href="#trunkLayoutTestsjsscriptteststypedarraysomejs">trunk/LayoutTests/js/script-tests/typedarray-some.js</a></li>
<li><a href="#trunkLayoutTestsjsscriptteststypedarraysortjs">trunk/LayoutTests/js/script-tests/typedarray-sort.js</a></li>
<li><a href="#trunkLayoutTestsjsscriptteststypedarraytesthelperfunctionsjs">trunk/LayoutTests/js/script-tests/typedarray-test-helper-functions.js</a></li>
<li><a href="#trunkLayoutTestsjstypedarraycopyWithinexpectedtxt">trunk/LayoutTests/js/typedarray-copyWithin-expected.txt</a></li>
<li><a href="#trunkLayoutTestsjstypedarraycopyWithinhtml">trunk/LayoutTests/js/typedarray-copyWithin.html</a></li>
<li><a href="#trunkLayoutTestsjstypedarrayeveryexpectedtxt">trunk/LayoutTests/js/typedarray-every-expected.txt</a></li>
<li><a href="#trunkLayoutTestsjstypedarrayeveryhtml">trunk/LayoutTests/js/typedarray-every.html</a></li>
<li><a href="#trunkLayoutTestsjstypedarrayfillexpectedtxt">trunk/LayoutTests/js/typedarray-fill-expected.txt</a></li>
<li><a href="#trunkLayoutTestsjstypedarrayfillhtml">trunk/LayoutTests/js/typedarray-fill.html</a></li>
<li><a href="#trunkLayoutTestsjstypedarrayfilterexpectedtxt">trunk/LayoutTests/js/typedarray-filter-expected.txt</a></li>
<li><a href="#trunkLayoutTestsjstypedarrayfilterhtml">trunk/LayoutTests/js/typedarray-filter.html</a></li>
<li><a href="#trunkLayoutTestsjstypedarrayfindexpectedtxt">trunk/LayoutTests/js/typedarray-find-expected.txt</a></li>
<li><a href="#trunkLayoutTestsjstypedarrayfindhtml">trunk/LayoutTests/js/typedarray-find.html</a></li>
<li><a href="#trunkLayoutTestsjstypedarrayfindIndexexpectedtxt">trunk/LayoutTests/js/typedarray-findIndex-expected.txt</a></li>
<li><a href="#trunkLayoutTestsjstypedarrayfindIndexhtml">trunk/LayoutTests/js/typedarray-findIndex.html</a></li>
<li><a href="#trunkLayoutTestsjstypedarrayforEachexpectedtxt">trunk/LayoutTests/js/typedarray-forEach-expected.txt</a></li>
<li><a href="#trunkLayoutTestsjstypedarrayforEachhtml">trunk/LayoutTests/js/typedarray-forEach.html</a></li>
<li><a href="#trunkLayoutTestsjstypedarrayindexOfexpectedtxt">trunk/LayoutTests/js/typedarray-indexOf-expected.txt</a></li>
<li><a href="#trunkLayoutTestsjstypedarrayindexOfhtml">trunk/LayoutTests/js/typedarray-indexOf.html</a></li>
<li><a href="#trunkLayoutTestsjstypedarraylastIndexOfexpectedtxt">trunk/LayoutTests/js/typedarray-lastIndexOf-expected.txt</a></li>
<li><a href="#trunkLayoutTestsjstypedarraylastIndexOfhtml">trunk/LayoutTests/js/typedarray-lastIndexOf.html</a></li>
<li><a href="#trunkLayoutTestsjstypedarraymapexpectedtxt">trunk/LayoutTests/js/typedarray-map-expected.txt</a></li>
<li><a href="#trunkLayoutTestsjstypedarraymaphtml">trunk/LayoutTests/js/typedarray-map.html</a></li>
<li><a href="#trunkLayoutTestsjstypedarrayreduceexpectedtxt">trunk/LayoutTests/js/typedarray-reduce-expected.txt</a></li>
<li><a href="#trunkLayoutTestsjstypedarrayreducehtml">trunk/LayoutTests/js/typedarray-reduce.html</a></li>
<li><a href="#trunkLayoutTestsjstypedarrayreduceRightexpectedtxt">trunk/LayoutTests/js/typedarray-reduceRight-expected.txt</a></li>
<li><a href="#trunkLayoutTestsjstypedarrayreduceRighthtml">trunk/LayoutTests/js/typedarray-reduceRight.html</a></li>
<li><a href="#trunkLayoutTestsjstypedarraysliceexpectedtxt">trunk/LayoutTests/js/typedarray-slice-expected.txt</a></li>
<li><a href="#trunkLayoutTestsjstypedarrayslicehtml">trunk/LayoutTests/js/typedarray-slice.html</a></li>
<li><a href="#trunkLayoutTestsjstypedarraysomeexpectedtxt">trunk/LayoutTests/js/typedarray-some-expected.txt</a></li>
<li><a href="#trunkLayoutTestsjstypedarraysomehtml">trunk/LayoutTests/js/typedarray-some.html</a></li>
<li><a href="#trunkLayoutTestsjstypedarraysortexpectedtxt">trunk/LayoutTests/js/typedarray-sort-expected.txt</a></li>
<li><a href="#trunkLayoutTestsjstypedarraysorthtml">trunk/LayoutTests/js/typedarray-sort.html</a></li>
<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>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (189063 => 189064)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2015-08-27 22:35:46 UTC (rev 189063)
+++ trunk/LayoutTests/ChangeLog        2015-08-27 22:57:07 UTC (rev 189064)
</span><span class="lines">@@ -1,3 +1,106 @@
</span><ins>+2015-08-27  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.
+
+        Added tests for the TypedArray.prototype functions.
+        All the tests use the typedarray-test-helper-function.js
+        to run the test on each TypedArray.
+
+        * fast/canvas/webgl/type-conversion-test-expected.txt:
+        * js/script-tests/typedarray-copyWithin.js: Added.
+        * js/script-tests/typedarray-every.js: Added.
+        (isBigEnough):
+        (isBigEnoughAndChange):
+        (isBigEnoughAndException):
+        * js/script-tests/typedarray-fill.js: Added.
+        * js/script-tests/typedarray-filter.js: Added.
+        (keepEven):
+        (keepEvenAndChange):
+        (isBigEnoughAndException):
+        * js/script-tests/typedarray-find.js: Added.
+        (keepEven):
+        (keepEvenAndChange):
+        (isBigEnoughAndException):
+        * js/script-tests/typedarray-findIndex.js: Added.
+        (keepEven):
+        (keepEvenAndChange):
+        (isBigEnoughAndException):
+        * js/script-tests/typedarray-forEach.js: Added.
+        (.checkCorrect.let.list):
+        (.checkCorrect):
+        (createChecker):
+        (foo):
+        (changeArray):
+        (isBigEnoughAndException):
+        * js/script-tests/typedarray-indexOf.js: Added.
+        (keepEven):
+        * js/script-tests/typedarray-lastIndexOf.js: Added.
+        * js/script-tests/typedarray-map.js: Added.
+        (even):
+        (evenAndChange):
+        (isBigEnoughAndException):
+        * js/script-tests/typedarray-reduce.js: Added.
+        (createArray):
+        (sum):
+        (createArrayAndChange):
+        (isBigEnoughAndException):
+        * js/script-tests/typedarray-reduceRight.js: Added.
+        (createArray):
+        (sum):
+        (createArrayAndChange):
+        (isBigEnoughAndException):
+        * js/script-tests/typedarray-slice.js: Added.
+        * js/script-tests/typedarray-some.js: Added.
+        (isBigEnough):
+        (isBigEnoughAndChange):
+        (isBigEnoughAndException):
+        * js/script-tests/typedarray-sort.js: Added.
+        (sortBackwards):
+        (compareException):
+        * js/script-tests/typedarray-test-helper-functions.js: Added.
+        (forEachTypedArray):
+        (isSameFunctionForEachTypedArrayPrototype.eq):
+        (isSameFunctionForEachTypedArrayPrototype):
+        (hasSameValues):
+        (.foo):
+        (testPrototypeFunctionHelper):
+        (testPrototypeFunctionOnSigned):
+        (testPrototypeFunctionOnFloat):
+        (testPrototypeFunction):
+        * js/typedarray-copyWithin-expected.txt: Added.
+        * js/typedarray-copyWithin.html: Added.
+        * js/typedarray-every-expected.txt: Added.
+        * js/typedarray-every.html: Added.
+        * js/typedarray-fill-expected.txt: Added.
+        * js/typedarray-fill.html: Added.
+        * js/typedarray-filter-expected.txt: Added.
+        * js/typedarray-filter.html: Added.
+        * js/typedarray-find-expected.txt: Added.
+        * js/typedarray-find.html: Added.
+        * js/typedarray-findIndex-expected.txt: Added.
+        * js/typedarray-findIndex.html: Added.
+        * js/typedarray-forEach-expected.txt: Added.
+        * js/typedarray-forEach.html: Added.
+        * js/typedarray-indexOf-expected.txt: Added.
+        * js/typedarray-indexOf.html: Added.
+        * js/typedarray-lastIndexOf-expected.txt: Added.
+        * js/typedarray-lastIndexOf.html: Added.
+        * js/typedarray-map-expected.txt: Added.
+        * js/typedarray-map.html: Added.
+        * js/typedarray-reduce-expected.txt: Added.
+        * js/typedarray-reduce.html: Added.
+        * js/typedarray-reduceRight-expected.txt: Added.
+        * js/typedarray-reduceRight.html: Added.
+        * js/typedarray-slice-expected.txt: Added.
+        * js/typedarray-slice.html: Added.
+        * js/typedarray-some-expected.txt: Added.
+        * js/typedarray-some.html: Added.
+        * js/typedarray-sort-expected.txt: Added.
+        * js/typedarray-sort.html: Added.
+
</ins><span class="cx"> 2015-08-27  Chris Dumez  &lt;cdumez@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Range.compareBoundaryPoints() should throw a NotSupportedError for invalid compareHow values
</span></span></pre></div>
<a id="trunkLayoutTestsfastcanvaswebgltypeconversiontestexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/canvas/webgl/type-conversion-test-expected.txt (189063 => 189064)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/canvas/webgl/type-conversion-test-expected.txt        2015-08-27 22:35:46 UTC (rev 189063)
+++ trunk/LayoutTests/fast/canvas/webgl/type-conversion-test-expected.txt        2015-08-27 22:57:07 UTC (rev 189064)
</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 (189063 => 189064)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/Window/window-postmessage-clone-expected.txt        2015-08-27 22:35:46 UTC (rev 189063)
+++ trunk/LayoutTests/fast/dom/Window/window-postmessage-clone-expected.txt        2015-08-27 22:57:07 UTC (rev 189064)
</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="trunkLayoutTestsjsscriptteststypedarraycopyWithinjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/js/script-tests/typedarray-copyWithin.js (0 => 189064)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/script-tests/typedarray-copyWithin.js                                (rev 0)
+++ trunk/LayoutTests/js/script-tests/typedarray-copyWithin.js        2015-08-27 22:57:07 UTC (rev 189064)
</span><span class="lines">@@ -0,0 +1,14 @@
</span><ins>+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;);
</ins></span></pre></div>
<a id="trunkLayoutTestsjsscriptteststypedarrayeveryjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/js/script-tests/typedarray-every.js (0 => 189064)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/script-tests/typedarray-every.js                                (rev 0)
+++ trunk/LayoutTests/js/script-tests/typedarray-every.js        2015-08-27 22:57:07 UTC (rev 189064)
</span><span class="lines">@@ -0,0 +1,54 @@
</span><ins>+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;);
+
</ins></span></pre></div>
<a id="trunkLayoutTestsjsscriptteststypedarrayfilljs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/js/script-tests/typedarray-fill.js (0 => 189064)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/script-tests/typedarray-fill.js                                (rev 0)
+++ trunk/LayoutTests/js/script-tests/typedarray-fill.js        2015-08-27 22:57:07 UTC (rev 189064)
</span><span class="lines">@@ -0,0 +1,33 @@
</span><ins>+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;);
</ins></span></pre></div>
<a id="trunkLayoutTestsjsscriptteststypedarrayfilterjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/js/script-tests/typedarray-filter.js (0 => 189064)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/script-tests/typedarray-filter.js                                (rev 0)
+++ trunk/LayoutTests/js/script-tests/typedarray-filter.js        2015-08-27 22:57:07 UTC (rev 189064)
</span><span class="lines">@@ -0,0 +1,49 @@
</span><ins>+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;);
</ins></span></pre></div>
<a id="trunkLayoutTestsjsscriptteststypedarrayfindjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/js/script-tests/typedarray-find.js (0 => 189064)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/script-tests/typedarray-find.js                                (rev 0)
+++ trunk/LayoutTests/js/script-tests/typedarray-find.js        2015-08-27 22:57:07 UTC (rev 189064)
</span><span class="lines">@@ -0,0 +1,51 @@
</span><ins>+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;);
</ins></span></pre></div>
<a id="trunkLayoutTestsjsscriptteststypedarrayfindIndexjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/js/script-tests/typedarray-findIndex.js (0 => 189064)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/script-tests/typedarray-findIndex.js                                (rev 0)
+++ trunk/LayoutTests/js/script-tests/typedarray-findIndex.js        2015-08-27 22:57:07 UTC (rev 189064)
</span><span class="lines">@@ -0,0 +1,51 @@
</span><ins>+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;);
</ins></span></pre></div>
<a id="trunkLayoutTestsjsscriptteststypedarrayforEachjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/js/script-tests/typedarray-forEach.js (0 => 189064)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/script-tests/typedarray-forEach.js                                (rev 0)
+++ trunk/LayoutTests/js/script-tests/typedarray-forEach.js        2015-08-27 22:57:07 UTC (rev 189064)
</span><span class="lines">@@ -0,0 +1,89 @@
</span><ins>+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;);
</ins></span></pre></div>
<a id="trunkLayoutTestsjsscriptteststypedarrayindexOfjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/js/script-tests/typedarray-indexOf.js (0 => 189064)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/script-tests/typedarray-indexOf.js                                (rev 0)
+++ trunk/LayoutTests/js/script-tests/typedarray-indexOf.js        2015-08-27 22:57:07 UTC (rev 189064)
</span><span class="lines">@@ -0,0 +1,29 @@
</span><ins>+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;);
</ins></span></pre></div>
<a id="trunkLayoutTestsjsscriptteststypedarraylastIndexOfjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/js/script-tests/typedarray-lastIndexOf.js (0 => 189064)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/script-tests/typedarray-lastIndexOf.js                                (rev 0)
+++ trunk/LayoutTests/js/script-tests/typedarray-lastIndexOf.js        2015-08-27 22:57:07 UTC (rev 189064)
</span><span class="lines">@@ -0,0 +1,26 @@
</span><ins>+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;);
</ins></span></pre></div>
<a id="trunkLayoutTestsjsscriptteststypedarraymapjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/js/script-tests/typedarray-map.js (0 => 189064)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/script-tests/typedarray-map.js                                (rev 0)
+++ trunk/LayoutTests/js/script-tests/typedarray-map.js        2015-08-27 22:57:07 UTC (rev 189064)
</span><span class="lines">@@ -0,0 +1,49 @@
</span><ins>+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;);
</ins></span></pre></div>
<a id="trunkLayoutTestsjsscriptteststypedarrayreducejs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/js/script-tests/typedarray-reduce.js (0 => 189064)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/script-tests/typedarray-reduce.js                                (rev 0)
+++ trunk/LayoutTests/js/script-tests/typedarray-reduce.js        2015-08-27 22:57:07 UTC (rev 189064)
</span><span class="lines">@@ -0,0 +1,56 @@
</span><ins>+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;);
</ins></span></pre></div>
<a id="trunkLayoutTestsjsscriptteststypedarrayreduceRightjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/js/script-tests/typedarray-reduceRight.js (0 => 189064)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/script-tests/typedarray-reduceRight.js                                (rev 0)
+++ trunk/LayoutTests/js/script-tests/typedarray-reduceRight.js        2015-08-27 22:57:07 UTC (rev 189064)
</span><span class="lines">@@ -0,0 +1,56 @@
</span><ins>+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;);
</ins></span></pre></div>
<a id="trunkLayoutTestsjsscriptteststypedarrayslicejs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/js/script-tests/typedarray-slice.js (0 => 189064)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/script-tests/typedarray-slice.js                                (rev 0)
+++ trunk/LayoutTests/js/script-tests/typedarray-slice.js        2015-08-27 22:57:07 UTC (rev 189064)
</span><span class="lines">@@ -0,0 +1,42 @@
</span><ins>+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;);
</ins></span></pre></div>
<a id="trunkLayoutTestsjsscriptteststypedarraysomejs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/js/script-tests/typedarray-some.js (0 => 189064)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/script-tests/typedarray-some.js                                (rev 0)
+++ trunk/LayoutTests/js/script-tests/typedarray-some.js        2015-08-27 22:57:07 UTC (rev 189064)
</span><span class="lines">@@ -0,0 +1,54 @@
</span><ins>+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;);
</ins></span></pre></div>
<a id="trunkLayoutTestsjsscriptteststypedarraysortjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/js/script-tests/typedarray-sort.js (0 => 189064)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/script-tests/typedarray-sort.js                                (rev 0)
+++ trunk/LayoutTests/js/script-tests/typedarray-sort.js        2015-08-27 22:57:07 UTC (rev 189064)
</span><span class="lines">@@ -0,0 +1,55 @@
</span><ins>+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;);
</ins></span></pre></div>
<a id="trunkLayoutTestsjsscriptteststypedarraytesthelperfunctionsjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/js/script-tests/typedarray-test-helper-functions.js (0 => 189064)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/script-tests/typedarray-test-helper-functions.js                                (rev 0)
+++ trunk/LayoutTests/js/script-tests/typedarray-test-helper-functions.js        2015-08-27 22:57:07 UTC (rev 189064)
</span><span class="lines">@@ -0,0 +1,100 @@
</span><ins>+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="trunkLayoutTestsjstypedarraycopyWithinexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/js/typedarray-copyWithin-expected.txt (0 => 189064)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/typedarray-copyWithin-expected.txt                                (rev 0)
+++ trunk/LayoutTests/js/typedarray-copyWithin-expected.txt        2015-08-27 22:57:07 UTC (rev 189064)
</span><span class="lines">@@ -0,0 +1,18 @@
</span><ins>+This test checks the behavior of the TypedArray.prototype.copyWithin function
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS Int32Array.prototype.copyWithin.length is 2
+PASS Int32Array.prototype.copyWithin.name is 'copyWithin'
+PASS isSameFunctionForEachTypedArrayPrototype('copyWithin') is true
+PASS testPrototypeReceivesArray('copyWithin', [undefined, this, { }, [ ], true, '']) is true
+PASS testPrototypeFunction('copyWithin', '(0, 3)', [1, 2, 3, 4, 5], [4, 5, 3, 4, 5]) is true
+PASS testPrototypeFunction('copyWithin', '(0, 3, 4)', [1, 2, 3, 4, 5], [4, 2, 3, 4, 5]) is true
+PASS testPrototypeFunction('copyWithin', '(0, -2, -1)', [1, 2, 3, 4, 5], [4, 2, 3, 4, 5]) is true
+PASS testPrototypeFunction('copyWithin', '(5, -5, 5)', [1, 2, 3, 4, 5], [1, 2, 3, 4, 5]) is true
+PASS testPrototypeFunction('copyWithin', '(1, -5, 5)', [1, 2, 3, 4, 5], [1, 1, 2, 3, 4]) is true
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsjstypedarraycopyWithinhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/js/typedarray-copyWithin.html (0 => 189064)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/typedarray-copyWithin.html                                (rev 0)
+++ trunk/LayoutTests/js/typedarray-copyWithin.html        2015-08-27 22:57:07 UTC (rev 189064)
</span><span class="lines">@@ -0,0 +1,11 @@
</span><ins>+&lt;!DOCTYPE HTML PUBLIC &quot;-//IETF//DTD HTML//EN&quot;&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;script src=&quot;script-tests/typedarray-test-helper-functions.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;script-tests/typedarray-copyWithin.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsjstypedarrayeveryexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/js/typedarray-every-expected.txt (0 => 189064)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/typedarray-every-expected.txt                                (rev 0)
+++ trunk/LayoutTests/js/typedarray-every-expected.txt        2015-08-27 22:57:07 UTC (rev 189064)
</span><span class="lines">@@ -0,0 +1,38 @@
</span><ins>+This test checks the behavior of the TypedArray.prototype.every function
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS Int32Array.prototype.every.length is 1
+PASS Int32Array.prototype.every.name is 'every'
+PASS isSameFunctionForEachTypedArrayPrototype('every') is true
+PASS testPrototypeReceivesArray('every', [undefined, this, { }, [ ], true, '']) is true
+
+testPrototypeFunction has the following arg list (name, args, init, result [ , expectedArray ])
+
+1.0 Single Argument Testing
+PASS testPrototypeFunction('every', '(isBigEnough)', [12, 5, 8, 13, 44], false) is true
+PASS testPrototypeFunction('every', '(isBigEnough)', [12, 54, 18, 13, 44], true) is true
+
+2.0 Two Argument Testing
+PASS testPrototypeFunction('every', '(isBigEnough, thisValue)', [12, 15, 10, 13, 44], false) is true
+PASS testPrototypeFunction('every', '(isBigEnough, thisValue)', [12, 54, 82, 13, 44], true) is true
+
+3.0 Array Element Changing
+PASS testPrototypeFunction('every', '(isBigEnoughAndChange)', [12, 15, 1, 13, 44], false, [12, 15, 5, 5, 5]) is true
+PASS testPrototypeFunction('every', '(isBigEnoughAndChange)', [12, 15, 10, 13, 44], false, [12, 5, 5, 5, 5]) is true
+
+4.0 Exception Test
+PASS testPrototypeFunction('every', '(isBigEnoughAndException)', [12, 15, 10, 13, 44], false) threw exception exception from function.
+
+5.0 Wrong Type for Callback Test
+PASS testPrototypeFunction('every', '(8)', [12, 15, 10, 13, 44], false) threw exception TypeError: TypedArray.prototype.every callback must be a function.
+PASS testPrototypeFunction('every', '(&quot;wrong&quot;)', [12, 15, 10, 13, 44], false) threw exception TypeError: TypedArray.prototype.every callback must be a function.
+PASS testPrototypeFunction('every', '(new Object())', [12, 15, 10, 13, 44], false) threw exception TypeError: TypedArray.prototype.every callback must be a function.
+PASS testPrototypeFunction('every', '(null)', [12, 15, 10, 13, 44], false) threw exception TypeError: TypedArray.prototype.every callback must be a function.
+PASS testPrototypeFunction('every', '()', [12, 15, 10, 13, 44], false) threw exception TypeError: TypedArray.prototype.every callback must be a function.
+
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsjstypedarrayeveryhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/js/typedarray-every.html (0 => 189064)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/typedarray-every.html                                (rev 0)
+++ trunk/LayoutTests/js/typedarray-every.html        2015-08-27 22:57:07 UTC (rev 189064)
</span><span class="lines">@@ -0,0 +1,11 @@
</span><ins>+&lt;!DOCTYPE HTML PUBLIC &quot;-//IETF//DTD HTML//EN&quot;&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;script src=&quot;script-tests/typedarray-test-helper-functions.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;script-tests/typedarray-every.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsjstypedarrayfillexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/js/typedarray-fill-expected.txt (0 => 189064)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/typedarray-fill-expected.txt                                (rev 0)
+++ trunk/LayoutTests/js/typedarray-fill-expected.txt        2015-08-27 22:57:07 UTC (rev 189064)
</span><span class="lines">@@ -0,0 +1,34 @@
</span><ins>+This test checks the behavior of the TypedArray.prototype.fill function
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS Int32Array.prototype.fill.length is 1
+PASS Int32Array.prototype.fill.name is 'fill'
+PASS isSameFunctionForEachTypedArrayPrototype('fill') is true
+PASS testPrototypeReceivesArray('fill', [undefined, this, { }, [ ], true, '']) is true
+
+testPrototypeFunction has the following arg list (name, args, init, result [ , expectedArray ])
+
+1.0 Single Argument Testing
+PASS testPrototypeFunction('fill', '(12)', [15, 5, 8, 13, 44], [12,12,12,12,12]) is true
+PASS testPrototypeFunction('fill', '(true)', [12, 54, 18, 13, 44], [1,1,1,1,1]) is true
+
+2.0 Two Argument Testing
+PASS testPrototypeFunction('fill', '(12, 2)', [14, 15, 10, 13, 44], [14, 15, 12, 12, 12]) is true
+PASS testPrototypeFunction('fill', '(4, NaN)', [14, 15, 10, 13, 44], [4, 4, 4, 4, 4]) is true
+PASS testPrototypeFunction('fill', '(4, -5)', [14, 15, 10, 13, 44], [4, 4, 4, 4, 4]) is true
+PASS testPrototypeFunction('fill', '(4, -1)', [14, 15, 10, 13, 44], [14, 15, 10, 13, 4]) is true
+
+3.0 Three Argument Testing
+PASS testPrototypeFunction('fill', '(4, -1, 0)', [14, 15, 10, 13, 44], [14, 15, 10, 13, 44]) is true
+PASS testPrototypeFunction('fill', '(4, 1, 1)', [14, 15, 10, 13, 44], [14, 15, 10, 13, 44]) is true
+PASS testPrototypeFunction('fill', '(4, 1, NaN)', [14, 15, 10, 13, 44], [14, 15, 10, 13, 44]) is true
+PASS testPrototypeFunction('fill', '(4, NaN, NaN)', [14, 15, 10, 13, 44], [14, 15, 10, 13, 44]) is true
+PASS testPrototypeFunction('fill', '(4, NaN, 5)', [14, 15, 10, 13, 44], [4, 4, 4, 4, 4]) is true
+PASS testPrototypeFunction('fill', '(4, -3, -2)', [14, 15, 10, 13, 44], [14, 15, 4, 13, 44]) is true
+PASS testPrototypeFunction('fill', '(4, 5, 5)', [14, 15, 10, 13, 44], [14, 15, 10, 13, 44]) is true
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsjstypedarrayfillhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/js/typedarray-fill.html (0 => 189064)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/typedarray-fill.html                                (rev 0)
+++ trunk/LayoutTests/js/typedarray-fill.html        2015-08-27 22:57:07 UTC (rev 189064)
</span><span class="lines">@@ -0,0 +1,11 @@
</span><ins>+&lt;!DOCTYPE HTML PUBLIC &quot;-//IETF//DTD HTML//EN&quot;&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;script src=&quot;script-tests/typedarray-test-helper-functions.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;script-tests/typedarray-fill.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsjstypedarrayfilterexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/js/typedarray-filter-expected.txt (0 => 189064)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/typedarray-filter-expected.txt                                (rev 0)
+++ trunk/LayoutTests/js/typedarray-filter-expected.txt        2015-08-27 22:57:07 UTC (rev 189064)
</span><span class="lines">@@ -0,0 +1,36 @@
</span><ins>+This test checks the behavior of the TypedArray.prototype.filter function
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS Int32Array.prototype.filter.length is 1
+PASS Int32Array.prototype.filter.name is 'filter'
+PASS isSameFunctionForEachTypedArrayPrototype('filter') is true
+PASS testPrototypeReceivesArray('filter', [undefined, this, { }, [ ], true, '']) is true
+
+testPrototypeFunction has the following arg list (name, args, init, result [ , expectedArray ])
+
+1.0 Single Argument Testing
+PASS testPrototypeFunction('filter', '(keepEven)', [12, 5, 8, 13, 44], [12, 8, 44]) is true
+PASS testPrototypeFunction('filter', '(keepEven)', [11, 54, 18, 13, 1], [54, 18]) is true
+
+2.0 Two Argument Testing
+PASS testPrototypeFunction('filter', '(keepEven, thisValue)', [12, 23, 11, 1, 45], [12, 23, 1]) is true
+
+3.0 Array Element Changing
+PASS testPrototypeFunction('filter', '(keepEvenAndChange)', [12, 15, 2, 13, 44], [12, 2], [5, 5, 5, 5, 5]) is true
+
+4.0 Exception Test
+PASS testPrototypeFunction('filter', '(isBigEnoughAndException)', [12, 15, 10, 13, 44], false) threw exception exception from function.
+
+5.0 Wrong Type for Callback Test
+PASS testPrototypeFunction('filter', '(8)', [12, 15, 10, 13, 44], false) threw exception TypeError: Array.prototype.map callback must be a function.
+PASS testPrototypeFunction('filter', '(&quot;wrong&quot;)', [12, 15, 10, 13, 44], false) threw exception TypeError: Array.prototype.map callback must be a function.
+PASS testPrototypeFunction('filter', '(new Object())', [12, 15, 10, 13, 44], false) threw exception TypeError: Array.prototype.map callback must be a function.
+PASS testPrototypeFunction('filter', '(null)', [12, 15, 10, 13, 44], false) threw exception TypeError: Array.prototype.map callback must be a function.
+PASS testPrototypeFunction('filter', '()', [12, 15, 10, 13, 44], false) threw exception TypeError: Array.prototype.map callback must be a function.
+
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsjstypedarrayfilterhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/js/typedarray-filter.html (0 => 189064)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/typedarray-filter.html                                (rev 0)
+++ trunk/LayoutTests/js/typedarray-filter.html        2015-08-27 22:57:07 UTC (rev 189064)
</span><span class="lines">@@ -0,0 +1,11 @@
</span><ins>+&lt;!DOCTYPE HTML PUBLIC &quot;-//IETF//DTD HTML//EN&quot;&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;script src=&quot;script-tests/typedarray-test-helper-functions.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;script-tests/typedarray-filter.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsjstypedarrayfindexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/js/typedarray-find-expected.txt (0 => 189064)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/typedarray-find-expected.txt                                (rev 0)
+++ trunk/LayoutTests/js/typedarray-find-expected.txt        2015-08-27 22:57:07 UTC (rev 189064)
</span><span class="lines">@@ -0,0 +1,38 @@
</span><ins>+This test checks the behavior of the TypedArray.prototype.find function
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS Int32Array.prototype.find.length is 1
+PASS Int32Array.prototype.find.name is 'find'
+PASS isSameFunctionForEachTypedArrayPrototype('find') is true
+PASS testPrototypeReceivesArray('find', [undefined, this, { }, [ ], true, '']) is true
+
+testPrototypeFunction has the following arg list (name, args, init, result [ , expectedArray ])
+
+1.0 Single Argument Testing
+PASS testPrototypeFunction('find', '(keepEven)', [12, 5, 8, 13, 44], 12) is true
+PASS testPrototypeFunction('find', '(keepEven)', [11, 13, 17, 13, 22], 22) is true
+PASS testPrototypeFunction('find', '(keepEven)', [11, 13, 17, 13, 11], undefined) is true
+
+2.0 Two Argument Testing
+PASS testPrototypeFunction('find', '(keepEven, thisValue)', [11, 23, 11, 1, 44], 1) is true
+
+3.0 Array Element Changing
+PASS testPrototypeFunction('find', '(keepEvenAndChange)', [11, 15, 3, 12, 44], undefined, [5, 5, 5, 5, 5]) is true
+
+4.0 Exception Test
+PASS testPrototypeFunction('find', '(isBigEnoughAndException)', [12, 15, 10, 13, 44], 12) is true
+PASS testPrototypeFunction('find', '(isBigEnoughAndException)', [9, 15, 10, 13, 44], false) threw exception exception from function.
+
+5.0 Wrong Type for Callback Test
+PASS testPrototypeFunction('find', '(8)', [12, 15, 10, 13, 44], false) threw exception TypeError: TypedArray.prototype.find callback must be a function.
+PASS testPrototypeFunction('find', '(&quot;wrong&quot;)', [12, 15, 10, 13, 44], false) threw exception TypeError: TypedArray.prototype.find callback must be a function.
+PASS testPrototypeFunction('find', '(new Object())', [12, 15, 10, 13, 44], false) threw exception TypeError: TypedArray.prototype.find callback must be a function.
+PASS testPrototypeFunction('find', '(null)', [12, 15, 10, 13, 44], false) threw exception TypeError: TypedArray.prototype.find callback must be a function.
+PASS testPrototypeFunction('find', '()', [12, 15, 10, 13, 44], false) threw exception TypeError: TypedArray.prototype.find callback must be a function.
+
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsjstypedarrayfindhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/js/typedarray-find.html (0 => 189064)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/typedarray-find.html                                (rev 0)
+++ trunk/LayoutTests/js/typedarray-find.html        2015-08-27 22:57:07 UTC (rev 189064)
</span><span class="lines">@@ -0,0 +1,11 @@
</span><ins>+&lt;!DOCTYPE HTML PUBLIC &quot;-//IETF//DTD HTML//EN&quot;&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;script src=&quot;script-tests/typedarray-test-helper-functions.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;script-tests/typedarray-find.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsjstypedarrayfindIndexexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/js/typedarray-findIndex-expected.txt (0 => 189064)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/typedarray-findIndex-expected.txt                                (rev 0)
+++ trunk/LayoutTests/js/typedarray-findIndex-expected.txt        2015-08-27 22:57:07 UTC (rev 189064)
</span><span class="lines">@@ -0,0 +1,38 @@
</span><ins>+This test checks the behavior of the TypedArray.prototype.findIndex function
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS Int32Array.prototype.findIndex.length is 1
+PASS Int32Array.prototype.findIndex.name is 'findIndex'
+PASS isSameFunctionForEachTypedArrayPrototype('findIndex') is true
+PASS testPrototypeReceivesArray('findIndex', [undefined, this, { }, [ ], true, '']) is true
+
+testPrototypeFunction has the following arg list (name, args, init, result [ , expectedArray ])
+
+1.0 Single Argument Testing
+PASS testPrototypeFunction('findIndex', '(keepEven)', [12, 5, 8, 13, 44], 0) is true
+PASS testPrototypeFunction('findIndex', '(keepEven)', [11, 13, 17, 13, 22], 4) is true
+PASS testPrototypeFunction('findIndex', '(keepEven)', [11, 13, 17, 13, 11], -1) is true
+
+2.0 Two Argument Testing
+PASS testPrototypeFunction('findIndex', '(keepEven, thisValue)', [11, 23, 11, 1, 44], 3) is true
+
+3.0 Array Element Changing
+PASS testPrototypeFunction('findIndex', '(keepEvenAndChange)', [11, 15, 3, 12, 44], -1, [5, 5, 5, 5, 5]) is true
+
+4.0 Exception Test
+PASS testPrototypeFunction('findIndex', '(isBigEnoughAndException)', [12, 15, 10, 13, 44], 0) is true
+PASS testPrototypeFunction('findIndex', '(isBigEnoughAndException)', [9, 15, 10, 13, 44], false) threw exception exception from function.
+
+5.0 Wrong Type for Callback Test
+PASS testPrototypeFunction('findIndex', '(8)', [12, 15, 10, 13, 44], false) threw exception TypeError: TypedArray.prototype.findIndex callback must be a function.
+PASS testPrototypeFunction('findIndex', '(&quot;wrong&quot;)', [12, 15, 10, 13, 44], false) threw exception TypeError: TypedArray.prototype.findIndex callback must be a function.
+PASS testPrototypeFunction('findIndex', '(new Object())', [12, 15, 10, 13, 44], false) threw exception TypeError: TypedArray.prototype.findIndex callback must be a function.
+PASS testPrototypeFunction('findIndex', '(null)', [12, 15, 10, 13, 44], false) threw exception TypeError: TypedArray.prototype.findIndex callback must be a function.
+PASS testPrototypeFunction('findIndex', '()', [12, 15, 10, 13, 44], false) threw exception TypeError: TypedArray.prototype.findIndex callback must be a function.
+
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsjstypedarrayfindIndexhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/js/typedarray-findIndex.html (0 => 189064)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/typedarray-findIndex.html                                (rev 0)
+++ trunk/LayoutTests/js/typedarray-findIndex.html        2015-08-27 22:57:07 UTC (rev 189064)
</span><span class="lines">@@ -0,0 +1,11 @@
</span><ins>+&lt;!DOCTYPE HTML PUBLIC &quot;-//IETF//DTD HTML//EN&quot;&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;script src=&quot;script-tests/typedarray-test-helper-functions.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;script-tests/typedarray-findIndex.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsjstypedarrayforEachexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/js/typedarray-forEach-expected.txt (0 => 189064)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/typedarray-forEach-expected.txt                                (rev 0)
+++ trunk/LayoutTests/js/typedarray-forEach-expected.txt        2015-08-27 22:57:07 UTC (rev 189064)
</span><span class="lines">@@ -0,0 +1,34 @@
</span><ins>+This test checks the behavior of the TypedArray.prototype.forEach function
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS Int32Array.prototype.forEach.length is 1
+PASS Int32Array.prototype.forEach.name is 'forEach'
+PASS isSameFunctionForEachTypedArrayPrototype('forEach') is true
+PASS testPrototypeReceivesArray('forEach', [undefined, this, { }, [ ], true, '']) is true
+
+1.0 Single Argument Testing
+PASS passed is true
+
+2.0 Two Argument Testing
+PASS passed &amp;&amp; thisPassed is true
+PASS passed &amp;&amp; !thisPassed is true
+
+3.0 Array Element Changing
+PASS passed &amp;&amp; hasSameValues('array did not mutate correctly', typedArray, [5, 5, 5, 5, 5]) is true
+
+4.0 Exception Test
+PASS testPrototypeFunction('forEach', '(isBigEnoughAndException)', [9, 15, 10, 13, 44], false) threw exception exception from function.
+
+5.0 Wrong Type for Callback Test
+PASS testPrototypeFunction('forEach', '(8)', [12, 15, 10, 13, 44], false) threw exception TypeError: TypedArray.prototype.findIndex callback must be a function.
+PASS testPrototypeFunction('forEach', '(&quot;wrong&quot;)', [12, 15, 10, 13, 44], false) threw exception TypeError: TypedArray.prototype.findIndex callback must be a function.
+PASS testPrototypeFunction('forEach', '(new Object())', [12, 15, 10, 13, 44], false) threw exception TypeError: TypedArray.prototype.findIndex callback must be a function.
+PASS testPrototypeFunction('forEach', '(null)', [12, 15, 10, 13, 44], false) threw exception TypeError: TypedArray.prototype.findIndex callback must be a function.
+PASS testPrototypeFunction('forEach', '()', [12, 15, 10, 13, 44], false) threw exception TypeError: TypedArray.prototype.findIndex callback must be a function.
+
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsjstypedarrayforEachhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/js/typedarray-forEach.html (0 => 189064)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/typedarray-forEach.html                                (rev 0)
+++ trunk/LayoutTests/js/typedarray-forEach.html        2015-08-27 22:57:07 UTC (rev 189064)
</span><span class="lines">@@ -0,0 +1,11 @@
</span><ins>+&lt;!DOCTYPE HTML PUBLIC &quot;-//IETF//DTD HTML//EN&quot;&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;script src=&quot;script-tests/typedarray-test-helper-functions.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;script-tests/typedarray-forEach.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsjstypedarrayindexOfexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/js/typedarray-indexOf-expected.txt (0 => 189064)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/typedarray-indexOf-expected.txt                                (rev 0)
+++ trunk/LayoutTests/js/typedarray-indexOf-expected.txt        2015-08-27 22:57:07 UTC (rev 189064)
</span><span class="lines">@@ -0,0 +1,26 @@
</span><ins>+This test checks the behavior of the TypedArray.prototype.indexOf function
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS Int32Array.prototype.indexOf.length is 1
+PASS Int32Array.prototype.indexOf.name is 'indexOf'
+PASS isSameFunctionForEachTypedArrayPrototype('indexOf') is true
+PASS testPrototypeReceivesArray('indexOf', [undefined, this, { }, [ ], true, '']) is true
+
+testPrototypeFunction has the following arg list (name, args, init, result [ , expectedArray ])
+
+PASS testPrototypeFunction('indexOf', '(2, -500)', array, 0) is true
+PASS testPrototypeFunction('indexOf', '(9, 500)', array, -1) is true
+PASS testPrototypeFunction('indexOf', '(2)', array, 0) is true
+PASS testPrototypeFunction('indexOf', '(7)', array, -1) is true
+PASS testPrototypeFunction('indexOf', '(2, 3)', array, 3) is true
+PASS testPrototypeFunction('indexOf', '(2, 2)', array, 3) is true
+PASS testPrototypeFunction('indexOf', '(2, 0)', array, 0) is true
+PASS testPrototypeFunction('indexOf', '(2, -1)', array, 3) is true
+PASS testPrototypeFunction('indexOf', '(2, -2)', array, 3) is true
+
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsjstypedarrayindexOfhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/js/typedarray-indexOf.html (0 => 189064)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/typedarray-indexOf.html                                (rev 0)
+++ trunk/LayoutTests/js/typedarray-indexOf.html        2015-08-27 22:57:07 UTC (rev 189064)
</span><span class="lines">@@ -0,0 +1,11 @@
</span><ins>+&lt;!DOCTYPE HTML PUBLIC &quot;-//IETF//DTD HTML//EN&quot;&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;script src=&quot;script-tests/typedarray-test-helper-functions.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;script-tests/typedarray-indexOf.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsjstypedarraylastIndexOfexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/js/typedarray-lastIndexOf-expected.txt (0 => 189064)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/typedarray-lastIndexOf-expected.txt                                (rev 0)
+++ trunk/LayoutTests/js/typedarray-lastIndexOf-expected.txt        2015-08-27 22:57:07 UTC (rev 189064)
</span><span class="lines">@@ -0,0 +1,27 @@
</span><ins>+This test checks the behavior of the TypedArray.prototype.lastIndexOf function
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS Int32Array.prototype.lastIndexOf.length is 1
+PASS Int32Array.prototype.lastIndexOf.name is 'lastIndexOf'
+PASS isSameFunctionForEachTypedArrayPrototype('lastIndexOf') is true
+PASS testPrototypeReceivesArray('lastIndexOf', [undefined, this, { }, [ ], true, '']) is true
+
+testPrototypeFunction has the following arg list (name, args, init, result [ , expectedArray ])
+
+PASS testPrototypeFunction('lastIndexOf', '(2, -500)', array, -1) is true
+PASS testPrototypeFunction('lastIndexOf', '(9, 500)', array, 2) is true
+PASS testPrototypeFunction('lastIndexOf', '(2)', array, 3) is true
+PASS testPrototypeFunction('lastIndexOf', '(5)', array, 1) is true
+PASS testPrototypeFunction('lastIndexOf', '(7)', array, -1) is true
+PASS testPrototypeFunction('lastIndexOf', '(2, 3)', array, 3) is true
+PASS testPrototypeFunction('lastIndexOf', '(2, 2)', array, 0) is true
+PASS testPrototypeFunction('lastIndexOf', '(2, 0)', array, 0) is true
+PASS testPrototypeFunction('lastIndexOf', '(2, -1)', array, 3) is true
+PASS testPrototypeFunction('lastIndexOf', '(2, -2)', array, 0) is true
+
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsjstypedarraylastIndexOfhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/js/typedarray-lastIndexOf.html (0 => 189064)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/typedarray-lastIndexOf.html                                (rev 0)
+++ trunk/LayoutTests/js/typedarray-lastIndexOf.html        2015-08-27 22:57:07 UTC (rev 189064)
</span><span class="lines">@@ -0,0 +1,11 @@
</span><ins>+&lt;!DOCTYPE HTML PUBLIC &quot;-//IETF//DTD HTML//EN&quot;&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;script src=&quot;script-tests/typedarray-test-helper-functions.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;script-tests/typedarray-lastIndexOf.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsjstypedarraymapexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/js/typedarray-map-expected.txt (0 => 189064)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/typedarray-map-expected.txt                                (rev 0)
+++ trunk/LayoutTests/js/typedarray-map-expected.txt        2015-08-27 22:57:07 UTC (rev 189064)
</span><span class="lines">@@ -0,0 +1,36 @@
</span><ins>+This test checks the behavior of the TypedArray.prototype.map function
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS Int32Array.prototype.map.length is 1
+PASS Int32Array.prototype.map.name is 'map'
+PASS isSameFunctionForEachTypedArrayPrototype('map') is true
+PASS testPrototypeReceivesArray('map', [undefined, this, { }, [ ], true, '']) is true
+
+testPrototypeFunction has the following arg list (name, args, init, result [ , expectedArray ])
+
+1.0 Single Argument Testing
+PASS testPrototypeFunction('map', '(even)', [12, 5, 8, 13, 44], [1, 0, 1, 0, 1], [12, 5, 8, 13, 44]) is true
+PASS testPrototypeFunction('map', '(even)', [11, 54, 18, 13, 1], [0, 1, 1, 0, 0]) is true
+
+2.0 Two Argument Testing
+PASS testPrototypeFunction('map', '(even, thisValue)', [12, 23, 11, 1, 45], [1, 1, 0, 1, 0]) is true
+
+3.0 Array Element Changing
+PASS testPrototypeFunction('map', '(evenAndChange)', [12, 15, 2, 13, 44], [1, 0, 1, 0, 0], [5, 5, 5, 5, 5]) is true
+
+4.0 Exception Test
+PASS testPrototypeFunction('map', '(isBigEnoughAndException)', [12, 15, 10, 13, 44], false) threw exception exception from function.
+
+5.0 Wrong Type for Callback Test
+PASS testPrototypeFunction('map', '(8)', [12, 15, 10, 13, 44], false) threw exception TypeError: TypedArray.prototype.map callback must be a function.
+PASS testPrototypeFunction('map', '(&quot;wrong&quot;)', [12, 15, 10, 13, 44], false) threw exception TypeError: TypedArray.prototype.map callback must be a function.
+PASS testPrototypeFunction('map', '(new Object())', [12, 15, 10, 13, 44], false) threw exception TypeError: TypedArray.prototype.map callback must be a function.
+PASS testPrototypeFunction('map', '(null)', [12, 15, 10, 13, 44], false) threw exception TypeError: TypedArray.prototype.map callback must be a function.
+PASS testPrototypeFunction('map', '()', [12, 15, 10, 13, 44], false) threw exception TypeError: TypedArray.prototype.map callback must be a function.
+
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsjstypedarraymaphtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/js/typedarray-map.html (0 => 189064)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/typedarray-map.html                                (rev 0)
+++ trunk/LayoutTests/js/typedarray-map.html        2015-08-27 22:57:07 UTC (rev 189064)
</span><span class="lines">@@ -0,0 +1,11 @@
</span><ins>+&lt;!DOCTYPE HTML PUBLIC &quot;-//IETF//DTD HTML//EN&quot;&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;script src=&quot;script-tests/typedarray-test-helper-functions.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;script-tests/typedarray-map.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsjstypedarrayreduceexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/js/typedarray-reduce-expected.txt (0 => 189064)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/typedarray-reduce-expected.txt                                (rev 0)
+++ trunk/LayoutTests/js/typedarray-reduce-expected.txt        2015-08-27 22:57:07 UTC (rev 189064)
</span><span class="lines">@@ -0,0 +1,36 @@
</span><ins>+This test checks the behavior of the TypedArray.prototype.reduce function
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS Int32Array.prototype.reduce.length is 1
+PASS Int32Array.prototype.reduce.name is 'reduce'
+PASS isSameFunctionForEachTypedArrayPrototype('reduce') is true
+PASS testPrototypeReceivesArray('reduce', [undefined, this, { }, [ ], true, '']) is true
+
+testPrototypeFunction has the following arg list (name, args, init, result [ , expectedArray ])
+
+1.0 Single Argument Testing
+PASS testPrototypeFunction('reduce', '(createArray)', [12, 5, 8, 13, 44], [12, 5, 8, 13, 44], [12, 5, 8, 13, 44]) is true
+PASS testPrototypeFunction('reduce', '(sum)', [1, 2, 3, 4, 5], 15) is true
+
+2.0 Two Argument Testing
+PASS testPrototypeFunction('reduce', '(createArray, [1])', [12, 23, 11, 1, 45], [1, 12, 23, 11, 1, 45], [12, 23, 11, 1, 45]) is true
+
+3.0 Array Element Changing
+PASS testPrototypeFunction('reduce', '(createArrayAndChange, [])', [12, 15, 2, 13, 44], [12, 15, 2, 5, 5], [5, 5, 5, 5, 5]) is true
+
+4.0 Exception Test
+PASS testPrototypeFunction('reduce', '(isBigEnoughAndException)', [12, 15, 10, 13, 44], false) threw exception exception from function.
+
+5.0 Wrong Type for Callback Test
+PASS testPrototypeFunction('reduce', '(8)', [12, 15, 10, 13, 44], false) threw exception TypeError: TypedArray.prototype.reduce callback must be a function.
+PASS testPrototypeFunction('reduce', '(&quot;wrong&quot;)', [12, 15, 10, 13, 44], false) threw exception TypeError: TypedArray.prototype.reduce callback must be a function.
+PASS testPrototypeFunction('reduce', '(new Object())', [12, 15, 10, 13, 44], false) threw exception TypeError: TypedArray.prototype.reduce callback must be a function.
+PASS testPrototypeFunction('reduce', '(null)', [12, 15, 10, 13, 44], false) threw exception TypeError: TypedArray.prototype.reduce callback must be a function.
+PASS testPrototypeFunction('reduce', '()', [12, 15, 10, 13, 44], false) threw exception TypeError: TypedArray.prototype.reduce callback must be a function.
+
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsjstypedarrayreducehtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/js/typedarray-reduce.html (0 => 189064)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/typedarray-reduce.html                                (rev 0)
+++ trunk/LayoutTests/js/typedarray-reduce.html        2015-08-27 22:57:07 UTC (rev 189064)
</span><span class="lines">@@ -0,0 +1,11 @@
</span><ins>+&lt;!DOCTYPE HTML PUBLIC &quot;-//IETF//DTD HTML//EN&quot;&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;script src=&quot;script-tests/typedarray-test-helper-functions.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;script-tests/typedarray-reduce.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsjstypedarrayreduceRightexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/js/typedarray-reduceRight-expected.txt (0 => 189064)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/typedarray-reduceRight-expected.txt                                (rev 0)
+++ trunk/LayoutTests/js/typedarray-reduceRight-expected.txt        2015-08-27 22:57:07 UTC (rev 189064)
</span><span class="lines">@@ -0,0 +1,36 @@
</span><ins>+This test checks the behavior of the TypedArray.prototype.reduceRight function
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS Int32Array.prototype.reduceRight.length is 1
+PASS Int32Array.prototype.reduceRight.name is 'reduceRight'
+PASS isSameFunctionForEachTypedArrayPrototype('reduceRight') is true
+PASS testPrototypeReceivesArray('reduceRight', [undefined, this, { }, [ ], true, '']) is true
+
+testPrototypeFunction has the following arg list (name, args, init, result [ , expectedArray ])
+
+1.0 Single Argument Testing
+PASS testPrototypeFunction('reduceRight', '(createArray)', [12, 5, 8, 13, 44], [12, 5, 8, 13, 44].reverse(), [12, 5, 8, 13, 44]) is true
+PASS testPrototypeFunction('reduceRight', '(sum)', [1, 2, 3, 4, 5], 15) is true
+
+2.0 Two Argument Testing
+PASS testPrototypeFunction('reduceRight', '(createArray, [1])', [12, 23, 11, 1, 45], [1, 45, 1, 11, 23, 12], [12, 23, 11, 1, 45]) is true
+
+3.0 Array Element Changing
+PASS testPrototypeFunction('reduceRight', '(createArrayAndChange, [])', [12, 15, 2, 13, 44], [44, 13, 2, 5, 5], [5, 5, 5, 5, 5]) is true
+
+4.0 Exception Test
+PASS testPrototypeFunction('reduceRight', '(isBigEnoughAndException)', [12, 15, 10, 13, 44], false) threw exception exception from function.
+
+5.0 Wrong Type for Callback Test
+PASS testPrototypeFunction('reduceRight', '(8)', [12, 15, 10, 13, 44], false) threw exception TypeError: TypedArray.prototype.reduceRight callback must be a function.
+PASS testPrototypeFunction('reduceRight', '(&quot;wrong&quot;)', [12, 15, 10, 13, 44], false) threw exception TypeError: TypedArray.prototype.reduceRight callback must be a function.
+PASS testPrototypeFunction('reduceRight', '(new Object())', [12, 15, 10, 13, 44], false) threw exception TypeError: TypedArray.prototype.reduceRight callback must be a function.
+PASS testPrototypeFunction('reduceRight', '(null)', [12, 15, 10, 13, 44], false) threw exception TypeError: TypedArray.prototype.reduceRight callback must be a function.
+PASS testPrototypeFunction('reduceRight', '()', [12, 15, 10, 13, 44], false) threw exception TypeError: TypedArray.prototype.reduceRight callback must be a function.
+
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsjstypedarrayreduceRighthtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/js/typedarray-reduceRight.html (0 => 189064)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/typedarray-reduceRight.html                                (rev 0)
+++ trunk/LayoutTests/js/typedarray-reduceRight.html        2015-08-27 22:57:07 UTC (rev 189064)
</span><span class="lines">@@ -0,0 +1,11 @@
</span><ins>+&lt;!DOCTYPE HTML PUBLIC &quot;-//IETF//DTD HTML//EN&quot;&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;script src=&quot;script-tests/typedarray-test-helper-functions.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;script-tests/typedarray-reduceRight.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsjstypedarraysliceexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/js/typedarray-slice-expected.txt (0 => 189064)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/typedarray-slice-expected.txt                                (rev 0)
+++ trunk/LayoutTests/js/typedarray-slice-expected.txt        2015-08-27 22:57:07 UTC (rev 189064)
</span><span class="lines">@@ -0,0 +1,31 @@
</span><ins>+This test checks the behavior of the TypedArray.prototype.slice function
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS Int32Array.prototype.slice.length is 2
+PASS Int32Array.prototype.slice.name is 'slice'
+PASS isSameFunctionForEachTypedArrayPrototype('slice') is true
+PASS testPrototypeReceivesArray('slice', [undefined, this, { }, [ ], true, '']) is true
+
+testPrototypeFunction has the following arg list (name, args, init, result [ , expectedArray ])
+
+1.0 Test Basic Functionality
+PASS testPrototypeFunction('slice', '(2, 3)', [12, 5, 8, 13, 44], [8], [12, 5, 8, 13, 44]) is true
+PASS testPrototypeFunction('slice', '(5, 5)', [12, 5, 8, 13, 44], []) is true
+PASS testPrototypeFunction('slice', '(0, 5)', [12, 5, 8, 13, 44], [12, 5, 8, 13, 44]) is true
+PASS testPrototypeFunction('slice', '(0, -5)', [12, 5, 8, 13, 44], []) is true
+PASS testPrototypeFunction('slice', '(-3, -2)', [12, 5, 8, 13, 44], [8]) is true
+PASS testPrototypeFunction('slice', '(4, 2)', [12, 5, 8, 13, 44], []) is true
+PASS testPrototypeFunction('slice', '(-50, 50)', [12, 5, 8, 13, 44], [12, 5, 8, 13, 44]) is true
+
+2.0 Preserve Underlying bits
+PASS intView[0] is -1
+
+3.0 Creates New Buffer
+PASS intView[0] is 0
+
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsjstypedarrayslicehtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/js/typedarray-slice.html (0 => 189064)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/typedarray-slice.html                                (rev 0)
+++ trunk/LayoutTests/js/typedarray-slice.html        2015-08-27 22:57:07 UTC (rev 189064)
</span><span class="lines">@@ -0,0 +1,11 @@
</span><ins>+&lt;!DOCTYPE HTML PUBLIC &quot;-//IETF//DTD HTML//EN&quot;&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;script src=&quot;script-tests/typedarray-test-helper-functions.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;script-tests/typedarray-slice.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsjstypedarraysomeexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/js/typedarray-some-expected.txt (0 => 189064)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/typedarray-some-expected.txt                                (rev 0)
+++ trunk/LayoutTests/js/typedarray-some-expected.txt        2015-08-27 22:57:07 UTC (rev 189064)
</span><span class="lines">@@ -0,0 +1,39 @@
</span><ins>+This test checks the behavior of the TypedArray.prototype.some function
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS Int32Array.prototype.some.length is 1
+PASS Int32Array.prototype.some.name is 'some'
+PASS isSameFunctionForEachTypedArrayPrototype('some') is true
+PASS testPrototypeReceivesArray('some', [undefined, this, { }, [ ], true, '']) is true
+
+testPrototypeFunction has the following arg list (name, args, init, result [ , expectedArray ])
+
+1.0 Single Argument Testing
+PASS testPrototypeFunction('some', '(isBigEnough)', [12, 5, 8, 13, 44], true, [12, 5, 8, 13, 44]) is true
+PASS testPrototypeFunction('some', '(isBigEnough)', [2, 4, 8, 3, 4], false) is true
+
+2.0 Two Argument Testing
+PASS testPrototypeFunction('some', '(isBigEnough, thisValue)', [2, 5, 10, 3, 4], false) is true
+PASS testPrototypeFunction('some', '(isBigEnough, thisValue)', [12, 54, 82, 13, 44], true) is true
+
+3.0 Array Element Changing
+PASS testPrototypeFunction('some', '(isBigEnoughAndChange)', [2, 5, 1, 13, 44], false, [5, 5, 5, 5, 5]) is true
+PASS testPrototypeFunction('some', '(isBigEnoughAndChange)', [12, 15, 10, 13, 44], true, [12, 15, 10, 13, 5]) is true
+
+4.0 Exception Test
+PASS testPrototypeFunction('some', '(isBigEnoughAndException)', [12, 15, 10, 13, 44], true) is true
+PASS testPrototypeFunction('some', '(isBigEnoughAndException)', [1, 15, 10, 13, 44], false) threw exception exception from function.
+
+5.0 Wrong Type for Callback Test
+PASS testPrototypeFunction('some', '(8)', [12, 15, 10, 13, 44], false) threw exception TypeError: TypedArray.prototype.some callback must be a function.
+PASS testPrototypeFunction('some', '(&quot;wrong&quot;)', [12, 15, 10, 13, 44], false) threw exception TypeError: TypedArray.prototype.some callback must be a function.
+PASS testPrototypeFunction('some', '(new Object())', [12, 15, 10, 13, 44], false) threw exception TypeError: TypedArray.prototype.some callback must be a function.
+PASS testPrototypeFunction('some', '(null)', [12, 15, 10, 13, 44], false) threw exception TypeError: TypedArray.prototype.some callback must be a function.
+PASS testPrototypeFunction('some', '()', [12, 15, 10, 13, 44], false) threw exception TypeError: TypedArray.prototype.some callback must be a function.
+
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsjstypedarraysomehtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/js/typedarray-some.html (0 => 189064)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/typedarray-some.html                                (rev 0)
+++ trunk/LayoutTests/js/typedarray-some.html        2015-08-27 22:57:07 UTC (rev 189064)
</span><span class="lines">@@ -0,0 +1,11 @@
</span><ins>+&lt;!DOCTYPE HTML PUBLIC &quot;-//IETF//DTD HTML//EN&quot;&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;script src=&quot;script-tests/typedarray-test-helper-functions.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;script-tests/typedarray-some.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsjstypedarraysortexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/js/typedarray-sort-expected.txt (0 => 189064)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/typedarray-sort-expected.txt                                (rev 0)
+++ trunk/LayoutTests/js/typedarray-sort-expected.txt        2015-08-27 22:57:07 UTC (rev 189064)
</span><span class="lines">@@ -0,0 +1,40 @@
</span><ins>+This test checks the behavior of the TypedArray.prototype.sort function
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS Int32Array.prototype.sort.length is 1
+PASS Int32Array.prototype.sort.name is 'sort'
+PASS isSameFunctionForEachTypedArrayPrototype('sort') is true
+PASS testPrototypeReceivesArray('sort', [undefined, this, { }, [ ], true, '']) is true
+
+testPrototypeFunction has the following arg list (name, args, init, result [ , expectedArray ])
+
+1.0 No Argument Testing
+PASS testPrototypeFunction('sort', '()', [12, 5, 8, 13, 44], [5, 8, 12, 13, 44], [5, 8, 12, 13, 44]) is true
+PASS testPrototypeFunction('sort', '()', [2, 4, 8, 3, 4], [2, 3, 4, 4, 8]) is true
+
+1.1 Signed Numbers
+PASS testPrototypeFunctionOnSigned('sort', '()', [12, -5, 8, -13, 44], [-13, -5, 8, 12, 44]) is true
+
+1.2 Float Numbers
+PASS testPrototypeFunctionOnFloat('sort', '()', [12, -5, 0, -0, -13, 44], [-13, -5, -0, 0, 12, 44]) is true
+1.3 Negative NaNs
+PASS Object.is(floatView[0],0) &amp;&amp; Object.is(floatView[1], NaN) is true
+
+2.0 Custom Function Testing
+PASS testPrototypeFunction('sort', '(sortBackwards)', [2, 5, 10, 3, 4], [10, 5, 4, 3, 2]) is true
+
+3.0 Exception Test
+PASS testPrototypeFunction('sort', '(compareException)', [12, 15, 10, 13, 44], true) threw exception exception from function.
+
+4.0 Wrong Type for Callback Test
+PASS testPrototypeFunction('sort', '(8)', [12, 15, 10, 13, 44], [10, 12, 13, 15, 44]) is true
+PASS testPrototypeFunction('sort', '(&quot;wrong&quot;)', [12, 15, 10, 13, 44], [10, 12, 13, 15, 44]) is true
+PASS testPrototypeFunction('sort', '(new Object())', [12, 15, 10, 13, 44], [10, 12, 13, 15, 44]) is true
+PASS testPrototypeFunction('sort', '(null)', [12, 15, 10, 13, 44], [10, 12, 13, 15, 44]) is true
+
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsjstypedarraysorthtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/js/typedarray-sort.html (0 => 189064)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/typedarray-sort.html                                (rev 0)
+++ trunk/LayoutTests/js/typedarray-sort.html        2015-08-27 22:57:07 UTC (rev 189064)
</span><span class="lines">@@ -0,0 +1,11 @@
</span><ins>+&lt;!DOCTYPE HTML PUBLIC &quot;-//IETF//DTD HTML//EN&quot;&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;script src=&quot;script-tests/typedarray-test-helper-functions.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;script-tests/typedarray-sort.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/CMakeLists.txt (189063 => 189064)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/CMakeLists.txt        2015-08-27 22:35:46 UTC (rev 189063)
+++ trunk/Source/JavaScriptCore/CMakeLists.txt        2015-08-27 22:57:07 UTC (rev 189064)
</span><span class="lines">@@ -558,6 +558,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 (189063 => 189064)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog        2015-08-27 22:35:46 UTC (rev 189063)
+++ trunk/Source/JavaScriptCore/ChangeLog        2015-08-27 22:57:07 UTC (rev 189064)
</span><span class="lines">@@ -1,3 +1,106 @@
</span><ins>+2015-08-27  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.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::sortFloat):
+        (JSC::JSGenericTypedArrayView::toAdaptorNativeFromValue):
+        (JSC::JSGenericTypedArrayView::setRangeToValue):
+        (JSC::JSGenericTypedArrayView::sort):
+        * 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.
+
</ins><span class="cx"> 2015-08-27  Alex Christensen  &lt;achristensen@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Isolate Source directories in CMake build
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreJavaScriptCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj (189063 => 189064)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj        2015-08-27 22:35:46 UTC (rev 189063)
+++ trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj        2015-08-27 22:57:07 UTC (rev 189064)
</span><span class="lines">@@ -972,6 +972,9 @@
</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 */; };
+                53917E841B791CB8000EBD33 /* TypedArray.prototype.js in Resources */ = {isa = PBXBuildFile; fileRef = 53917E831B791CB8000EBD33 /* TypedArray.prototype.js */; };
+                53F256E21B87E28000B4B768 /* JSTypedArrayViewPrototype.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 53F256E11B87E28000B4B768 /* JSTypedArrayViewPrototype.cpp */; };
</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">@@ -2758,6 +2761,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">@@ -4737,6 +4744,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">                                 14DE0D680D02431400AACCA2 /* JSGlobalObject.cpp */,
</span><span class="cx">                                 A8E894330CD0603F00367179 /* JSGlobalObject.h */,
</span><span class="lines">@@ -4813,6 +4821,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">                                 0F2B66D217B6B5AB00A7AE3F /* JSUint8Array.h */,
</span><span class="cx">                                 0F2B66D317B6B5AB00A7AE3F /* JSUint8ClampedArray.h */,
</span><span class="lines">@@ -5794,6 +5804,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">@@ -6437,6 +6448,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">@@ -7032,6 +7044,7 @@
</span><span class="cx">                         buildActionMask = 2147483647;
</span><span class="cx">                         files = (
</span><span class="cx">                                 A53F1AC018C90F8F0072EB6D /* framework.sb in Resources */,
</span><ins>+                                53917E841B791CB8000EBD33 /* TypedArray.prototype.js in Resources */,
</ins><span class="cx">                         );
</span><span class="cx">                         runOnlyForDeploymentPostprocessing = 0;
</span><span class="cx">                 };
</span><span class="lines">@@ -7899,6 +7912,7 @@
</span><span class="cx">                                 C225494315F7DBAA0065E898 /* SlotVisitor.cpp in Sources */,
</span><span class="cx">                                 9330402C0E6A764000786E6A /* SmallStrings.cpp in Sources */,
</span><span class="cx">                                 E3EF88741B66DF23003F26CB /* JSPropertyNameIterator.cpp in Sources */,
</span><ins>+                                53F256E21B87E28000B4B768 /* JSTypedArrayViewPrototype.cpp in Sources */,
</ins><span class="cx">                                 0F8F2B9E17306C8D007DBDA5 /* SourceCode.cpp in Sources */,
</span><span class="cx">                                 0F493AFA16D0CAD30084508B /* SourceProvider.cpp in Sources */,
</span><span class="cx">                                 E49DC16B12EF293E00184A1F /* SourceProviderCache.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebuiltinsTypedArrayprototypejs"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/builtins/TypedArray.prototype.js (0 => 189064)</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-08-27 22:57:07 UTC (rev 189064)
</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 (189063 => 189064)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/ArrayPrototype.cpp        2015-08-27 22:35:46 UTC (rev 189063)
+++ trunk/Source/JavaScriptCore/runtime/ArrayPrototype.cpp        2015-08-27 22:57:07 UTC (rev 189064)
</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 (189063 => 189064)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/ArrayPrototype.h        2015-08-27 22:35:46 UTC (rev 189063)
+++ trunk/Source/JavaScriptCore/runtime/ArrayPrototype.h        2015-08-27 22:57:07 UTC (rev 189064)
</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 (189063 => 189064)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/CommonIdentifiers.h        2015-08-27 22:35:46 UTC (rev 189063)
+++ trunk/Source/JavaScriptCore/runtime/CommonIdentifiers.h        2015-08-27 22:57:07 UTC (rev 189064)
</span><span class="lines">@@ -291,6 +291,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 (189063 => 189064)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSGenericTypedArrayView.h        2015-08-27 22:35:46 UTC (rev 189063)
+++ trunk/Source/JavaScriptCore/runtime/JSGenericTypedArrayView.h        2015-08-27 22:57:07 UTC (rev 189064)
</span><span class="lines">@@ -83,10 +83,59 @@
</span><span class="cx"> //     template&lt;T&gt; static T::Type convertTo(uint8_t);
</span><span class="cx"> // };
</span><span class="cx"> 
</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. 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.
+//
+// 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.
+
+template&lt;typename FloatType, typename IntegralType&gt;
+void sortFloat(FloatType* floatArray, unsigned length)
+{
+    static_assert(sizeof(IntegralType) == sizeof(FloatType), &quot;floating point type and integral type must be the same size&quot;);
+
+    // We need this union because of the strict aliasing rule in C/C++.
+    union TypeConverter {
+        FloatType floatType;
+        IntegralType intType;
+    };
+
+    // 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.
+    TypeConverter* unionArray = reinterpret_cast&lt;TypeConverter*&gt;(floatArray);
+    for (unsigned i = 0; i &lt; length; ++i)
+        unionArray[i].floatType = purifyNaN(unionArray[i].floatType);
+
+    std::sort(unionArray, unionArray + length, [](TypeConverter a, TypeConverter b) {
+        if (a.intType &gt;= 0 || b.intType &gt;= 0)
+            return a.intType &lt; b.intType;
+        return a.intType &gt; b.intType;
+    });
+}
+
</ins><span class="cx"> template&lt;typename Adaptor&gt;
</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 +217,47 @@
</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()
+    {
+        typename Adaptor::Type* array = typedVector();
+        switch (Adaptor::typeValue) {
+        case TypeFloat32:
+            sortFloat&lt;float, int32_t&gt;(reinterpret_cast&lt;float*&gt;(array), m_length);
+            break;
+        case TypeFloat64:
+            sortFloat&lt;double, int64_t&gt;(reinterpret_cast&lt;double*&gt;(array), m_length);
+            break;
+        default:
+            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></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSGenericTypedArrayViewInlinesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSGenericTypedArrayViewInlines.h (189063 => 189064)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSGenericTypedArrayViewInlines.h        2015-08-27 22:35:46 UTC (rev 189063)
+++ trunk/Source/JavaScriptCore/runtime/JSGenericTypedArrayViewInlines.h        2015-08-27 22:57:07 UTC (rev 189064)
</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 => 189064)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSGenericTypedArrayViewPrototypeFunctions.h                                (rev 0)
+++ trunk/Source/JavaScriptCore/runtime/JSGenericTypedArrayViewPrototypeFunctions.h        2015-08-27 22:57:07 UTC (rev 189064)
</span><span class="lines">@@ -0,0 +1,397 @@
</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;JSArrayBufferView.h&quot;
+#include &quot;JSArrayIterator.h&quot;
+#include &quot;JSCBuiltins.h&quot;
+#include &quot;JSFunction.h&quot;
+#include &quot;JSGenericTypedArrayViewInlines.h&quot;
+#include &quot;JSGenericTypedArrayViewPrototypeInlines.h&quot;
+#include &quot;JSStringJoiner.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 (189063 => 189064)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSGenericTypedArrayViewPrototypeInlines.h        2015-08-27 22:35:46 UTC (rev 189063)
+++ trunk/Source/JavaScriptCore/runtime/JSGenericTypedArrayViewPrototypeInlines.h        2015-08-27 22:57:07 UTC (rev 189064)
</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 (189063 => 189064)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSGlobalObject.cpp        2015-08-27 22:35:46 UTC (rev 189063)
+++ trunk/Source/JavaScriptCore/runtime/JSGlobalObject.cpp        2015-08-27 22:57:07 UTC (rev 189064)
</span><span class="lines">@@ -96,6 +96,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">@@ -286,16 +287,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">@@ -477,6 +480,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">@@ -488,6 +493,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 (189063 => 189064)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSObject.h        2015-08-27 22:35:46 UTC (rev 189063)
+++ trunk/Source/JavaScriptCore/runtime/JSObject.h        2015-08-27 22:57:07 UTC (rev 189064)
</span><span class="lines">@@ -1482,6 +1482,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 (189063 => 189064)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSTypedArrayPrototypes.cpp        2015-08-27 22:35:46 UTC (rev 189063)
+++ trunk/Source/JavaScriptCore/runtime/JSTypedArrayPrototypes.cpp        2015-08-27 22:57:07 UTC (rev 189064)
</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 (189063 => 189064)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSTypedArrayPrototypes.h        2015-08-27 22:35:46 UTC (rev 189063)
+++ trunk/Source/JavaScriptCore/runtime/JSTypedArrayPrototypes.h        2015-08-27 22:57:07 UTC (rev 189064)
</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 => 189064)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSTypedArrayViewPrototype.cpp                                (rev 0)
+++ trunk/Source/JavaScriptCore/runtime/JSTypedArrayViewPrototype.cpp        2015-08-27 22:57:07 UTC (rev 189064)
</span><span class="lines">@@ -0,0 +1,269 @@
</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;JSArrayBufferViewInlines.h&quot;
+#include &quot;JSCJSValueInlines.h&quot;
+#include &quot;JSCellInlines.h&quot;
+#include &quot;JSFunction.h&quot;
+#include &quot;JSGenericTypedArrayViewPrototypeFunctions.h&quot;
+#include &quot;StructureInlines.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 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 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);
+    putDirectWithoutTransition(vm, vm.propertyNames-&gt;iteratorSymbol, valuesFunction);
+
+}
+
+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="trunkSourceJavaScriptCoreruntimeJSTypedArrayViewPrototypehfromrev189063trunkSourceJavaScriptCoreruntimeJSTypedArrayPrototypescpp"></a>
<div class="copfile"><h4>Copied: trunk/Source/JavaScriptCore/runtime/JSTypedArrayViewPrototype.h (from rev 189063, trunk/Source/JavaScriptCore/runtime/JSTypedArrayPrototypes.cpp) (0 => 189064)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSTypedArrayViewPrototype.h                                (rev 0)
+++ trunk/Source/JavaScriptCore/runtime/JSTypedArrayViewPrototype.h        2015-08-27 22:57:07 UTC (rev 189064)
</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>
</div>

</body>
</html>