| 1 |
// Copyright 2015 Microsoft Corporation. All rights reserved. |
| 2 |
// This code is governed by the license found in the LICENSE file. |
| 3 |
|
| 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 |
---*/ |
| 11 |
|
| 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 |
| 20 |
}; |
| 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], "Elements mismatch at " + j + "."); |
| 25 |
} |