Bug 1892041 - Part 2: Update test262. r=spidermonkey-reviewers,dminor
[gecko.git] / js / src / tests / test262 / built-ins / Array / from / source-object-length.js
blobc9262c824b3438097163da6f38d64466c550f0ca
1 // Copyright 2015 Microsoft Corporation. All rights reserved.
2 // This code is governed by the license found in the LICENSE file.
4 /*---
5 description: >
6     Source is an object with length property and one item is deleted
7     from the source
8 esid: sec-array.from
9 es6id: 22.1.2.1
10 ---*/
12 var array = [2, 4, 0, 16];
13 var expectedArray = [2, 4, , 16];
14 var obj = {
15   length: 4,
16   0: 2,
17   1: 4,
18   2: 0,
19   3: 16
21 delete obj[2];
22 var a = Array.from(obj);
23 for (var j = 0; j < expectedArray.length; j++) {
24   assert.sameValue(a[j], expectedArray[j], 'The value of a[j] is expected to equal the value of expectedArray[j]');
27 reportCompare(0, 0);