diff options
Diffstat (limited to 'js/src/tests/test262/built-ins/Array/prototype/copyWithin/fill-holes.js')
-rw-r--r-- | js/src/tests/test262/built-ins/Array/prototype/copyWithin/fill-holes.js | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/js/src/tests/test262/built-ins/Array/prototype/copyWithin/fill-holes.js b/js/src/tests/test262/built-ins/Array/prototype/copyWithin/fill-holes.js new file mode 100644 index 0000000000..972c5d82a7 --- /dev/null +++ b/js/src/tests/test262/built-ins/Array/prototype/copyWithin/fill-holes.js @@ -0,0 +1,20 @@ +// Copyright (C) 2015 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-array.prototype.copywithin +description: > + Loop from each property, even empty holes. +---*/ + +var arr = [0, 1, , , 1]; + +arr.copyWithin(0, 1, 4); + +assert.sameValue(arr.length, 5); +assert.sameValue(arr[0], 1); +assert.sameValue(arr[4], 1); +assert.sameValue(arr.hasOwnProperty(1), false); +assert.sameValue(arr.hasOwnProperty(2), false); +assert.sameValue(arr.hasOwnProperty(3), false); + +reportCompare(0, 0); |