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

Unified Diff: src/harmony-array.js

Issue 1131113002: TypedArray.prototype.copyWithin method (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: better description Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/harmony-typedarray.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/harmony-array.js
diff --git a/src/harmony-array.js b/src/harmony-array.js
index 8520f351d158e7693d11fba3f15c1ce41a78fdbd..acf1b145e414774ab6604da2dd0bb7268e936d38 100644
--- a/src/harmony-array.js
+++ b/src/harmony-array.js
@@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+var $innerArrayCopyWithin;
+
(function(global, exports) {
'use strict';
@@ -13,13 +15,7 @@ var GlobalSymbol = global.Symbol;
// -------------------------------------------------------------------
-// ES6 draft 03-17-15, section 22.1.3.3
-function ArrayCopyWithin(target, start, end) {
- CHECK_OBJECT_COERCIBLE(this, "Array.prototype.copyWithin");
-
- var array = TO_OBJECT_INLINE(this);
- var length = $toLength(array.length);
-
+function InnerArrayCopyWithin(target, start, end, array, length) {
target = TO_INTEGER(target);
var to;
if (target < 0) {
@@ -65,6 +61,17 @@ function ArrayCopyWithin(target, start, end) {
return array;
}
+$innerArrayCopyWithin = InnerArrayCopyWithin;
+
+// ES6 draft 03-17-15, section 22.1.3.3
+function ArrayCopyWithin(target, start, end) {
+ CHECK_OBJECT_COERCIBLE(this, "Array.prototype.copyWithin");
+
+ var array = TO_OBJECT_INLINE(this);
+ var length = $toLength(array.length);
+
+ return InnerArrayCopyWithin(target, start, end, array, length);
+}
// ES6 draft 07-15-13, section 15.4.3.23
function ArrayFind(predicate /* thisArg */) { // length == 1
« no previous file with comments | « no previous file | src/harmony-typedarray.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698