| 1 |
// Copyright (c) 2014 Hank Yates. All rights reserved. |
| 2 |
// This code is governed by the BSD license found in the LICENSE file. |
| 3 |
|
| 4 |
/*--- |
| 5 |
esid: sec-array.from |
| 6 |
es6id: 22.1.2.1 |
| 7 |
description: Testing Array.from when passed a String |
| 8 |
author: Hank Yates ([email protected]) |
| 9 |
---*/ |
| 10 |
|
| 11 |
var arrLikeSource = 'Test'; |
| 12 |
var result = Array.from(arrLikeSource); |
| 13 |
|
| 14 |
assert.sameValue(result.length, 4, 'result.length'); |
| 15 |
assert.sameValue(result[0], 'T', 'result[0]'); |
| 16 |
assert.sameValue(result[1], 'e', 'result[1]'); |
| 17 |
assert.sameValue(result[2], 's', 'result[2]'); |
| 18 |
assert.sameValue(result[3], 't', 'result[3]'); |