| 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: Source is an object with missing values |
| 6 |
esid: sec-array.from |
| 7 |
es6id: 22.1.2.1 |
| 8 |
---*/ |
| 9 |
|
| 10 |
var array = [2, 4, , 16]; |
| 11 |
var obj = { |
| 12 |
length: 4, |
| 13 |
0: 2, |
| 14 |
1: 4, |
| 15 |
3: 16 |
| 16 |
}; |
| 17 |
|
| 18 |
var a = Array.from.call(Object, obj); |
| 19 |
assert.sameValue(typeof a, "object", "The returned type is expected to be object."); |
| 20 |
for (var j = 0; j < a.length; j++) { |
| 21 |
assert.sameValue(a[j], array[j], "Elements mismatch at " + j + "."); |
| 22 |
} |