array-like-has-length-but-no-indexes-with-values.js |
---
esid: sec-array.from
description: >
Creates an array with length that is equal to the value of the
length property of the given array-like, regardless of
the presence of corresponding indices and values.
info: |
Array.from ( items [ , mapfn [ , thisArg ] ] )
7. Let arrayLike be ! ToObject(items).
8. Let len be ? LengthOfArrayLike(arrayLike).
9. If IsConstructor(C) is true, then
a. Let A be ? Construct(C, « 𝔽(len) »).
10. Else,
a. Let A be ? ArrayCreate(len).
includes: [compareArray.js]
--- |
1379 |
Array.from-descriptor.js |
---
description: Testing descriptor property of Array.from
includes: [propertyHelper.js]
esid: sec-array.from
--- |
373 |
Array.from-name.js |
---
esid: sec-array.from
description: '`name` property'
info: |
ES6 Section 17:
Every built-in Function object, including constructors, that is not
identified as an anonymous function has a name property whose value is a
String. Unless otherwise specified, this value is the name that is given to
the function in this specification.
[...]
Unless otherwise specified, the name property of a built-in Function
object, if it exists, has the attributes { [[Writable]]: false,
[[Enumerable]]: false, [[Configurable]]: true }.
includes: [propertyHelper.js]
--- |
869 |
Array.from_arity.js |
---
esid: sec-array.from
description: >
The length property of the Array.from method is 1.
info: |
22.1.2.1 Array.from ( items [ , mapfn [ , thisArg ] ] )
...
The length property of the from method is 1.
includes: [propertyHelper.js]
--- |
562 |
Array.from_forwards-length-for-array-likes.js |
---
esid: sec-array.from
description: >
If this is a constructor, and items doesn't have an @@iterator,
returns a new instance of this
info: |
22.1.2.1 Array.from ( items [ , mapfn [ , thisArg ] ] )
4. Let usingIterator be GetMethod(items, @@iterator).
...
6. If usingIterator is not undefined, then
...
12. If IsConstructor(C) is true, then
a. Let A be Construct(C, «len»).
13. Else,
a. Let A be ArrayCreate(len).
...
19. Return A.
--- |
1110 |
browser.js |
|
0 |
calling-from-valid-1-noStrict.js |
---
esid: sec-array.from
description: Map function without thisArg on non strict mode
info: |
22.1.2.1 Array.from ( items [ , mapfn [ , thisArg ] ] )
...
10. Let len be ToLength(Get(arrayLike, "length")).
11. ReturnIfAbrupt(len).
12. If IsConstructor(C) is true, then
a. Let A be Construct(C, «len»).
13. Else,
b. Let A be ArrayCreate(len).
14. ReturnIfAbrupt(A).
15. Let k be 0.
16. Repeat, while k < len
a. Let Pk be ToString(k).
b. Let kValue be Get(arrayLike, Pk).
c. ReturnIfAbrupt(kValue).
d. If mapping is true, then
i. Let mappedValue be Call(mapfn, T, «kValue, k»).
...
flags: [noStrict]
--- |
2602 |
calling-from-valid-1-onlyStrict-strict.js |
---
esid: sec-array.from
description: Map function without thisArg on strict mode
info: |
22.1.2.1 Array.from ( items [ , mapfn [ , thisArg ] ] )
...
10. Let len be ToLength(Get(arrayLike, "length")).
11. ReturnIfAbrupt(len).
12. If IsConstructor(C) is true, then
a. Let A be Construct(C, «len»).
13. Else,
b. Let A be ArrayCreate(len).
14. ReturnIfAbrupt(A).
15. Let k be 0.
16. Repeat, while k < len
a. Let Pk be ToString(k).
b. Let kValue be Get(arrayLike, Pk).
c. ReturnIfAbrupt(kValue).
d. If mapping is true, then
i. Let mappedValue be Call(mapfn, T, «kValue, k»).
...
flags: [onlyStrict]
--- |
2653 |
calling-from-valid-2.js |
---
esid: sec-array.from
description: Calling from with a valid map function with thisArg
info: |
22.1.2.1 Array.from ( items [ , mapfn [ , thisArg ] ] )
...
10. Let len be ToLength(Get(arrayLike, "length")).
11. ReturnIfAbrupt(len).
12. If IsConstructor(C) is true, then
a. Let A be Construct(C, «len»).
13. Else,
b. Let A be ArrayCreate(len).
14. ReturnIfAbrupt(A).
15. Let k be 0.
16. Repeat, while k < len
a. Let Pk be ToString(k).
b. Let kValue be Get(arrayLike, Pk).
c. ReturnIfAbrupt(kValue).
d. If mapping is true, then
i. Let mappedValue be Call(mapfn, T, «kValue, k»).
...
--- |
2682 |
elements-added-after.js |
---
description: Elements added after the call to from
esid: sec-array.from
--- |
1067 |
elements-deleted-after.js |
---
description: >
Elements deleted after the call started and before visited are not
visited
esid: sec-array.from
--- |
1039 |
elements-updated-after.js |
---
description: Elements are updated after the call to from
esid: sec-array.from
--- |
883 |
from-array.js |
---
description: Passing a valid array
esid: sec-array.from
--- |
955 |
from-string.js |
---
esid: sec-array.from
description: Testing Array.from when passed a String
author: Hank Yates (hankyates@gmail.com)
--- |
760 |
get-iter-method-err.js |
---
esid: sec-array.from
description: Error accessing items' `Symbol.iterator` attribute
info: |
[...]
4. Let usingIterator be GetMethod(items, @@iterator).
5. ReturnIfAbrupt(usingIterator).
features: [Symbol.iterator]
--- |
642 |
items-is-arraybuffer.js |
---
esid: sec-array.from
description: Return empty array if items argument is an ArrayBuffer
info: |
22.1.2.1 Array.from ( items [ , mapfn [ , thisArg ] ] )
...
4. Let usingIterator be GetMethod(items, @@iterator).
5. ReturnIfAbrupt(usingIterator).
...
--- |
582 |
items-is-null-throws.js |
---
esid: sec-array.from
description: Throws a TypeError if items argument is null
info: |
22.1.2.1 Array.from ( items [ , mapfn [ , thisArg ] ] )
...
4. Let usingIterator be GetMethod(items, @@iterator).
5. ReturnIfAbrupt(usingIterator).
...
--- |
519 |
iter-adv-err.js |
---
esid: sec-array.from
description: Error advancing iterator
info: |
[...]
6. If usingIterator is not undefined, then
[...]
g. Repeat
i. Let Pk be ToString(k).
ii. Let next be IteratorStep(iterator).
iii. ReturnIfAbrupt(next).
features: [Symbol.iterator]
--- |
732 |
iter-cstm-ctor-err.js |
---
esid: sec-array.from
description: >
Error creating object with custom constructor (traversed via iterator)
info: |
[...]
6. If usingIterator is not undefined, then
a. If IsConstructor(C) is true, then
i. Let A be Construct(C).
b. Else,
i. Let A be ArrayCreate(0).
c. ReturnIfAbrupt(A).
features: [Symbol.iterator]
--- |
784 |
iter-cstm-ctor.js |
---
esid: sec-array.from
description: Creating object with custom constructor (traversed via iterator)
info: |
[...]
6. If usingIterator is not undefined, then
a. If IsConstructor(C) is true, then
i. Let A be Construct(C).
b. Else,
i. Let A be ArrayCreate(0).
c. ReturnIfAbrupt(A).
features: [Symbol.iterator]
--- |
1327 |
iter-get-iter-err.js |
---
esid: sec-array.from
description: Error creating iterator object
info: |
[...]
6. If usingIterator is not undefined, then
[...]
d. Let iterator be GetIterator(items, usingIterator).
e. ReturnIfAbrupt(iterator).
features: [Symbol.iterator]
--- |
734 |
iter-get-iter-val-err.js |
---
esid: sec-array.from
description: Error retrieving value of iterator result
info: |
[...]
6. If usingIterator is not undefined, then
[...]
g. Repeat
[...]
v. Let nextValue be IteratorValue(next).
vi. ReturnIfAbrupt(nextValue).
features: [Symbol.iterator]
--- |
944 |
iter-map-fn-args.js |
---
esid: sec-array.from
description: >
Arguments of mapping function (traversed via iterator)
info: |
[...]
2. If mapfn is undefined, let mapping be false.
3. else
a. If IsCallable(mapfn) is false, throw a TypeError exception.
b. If thisArg was supplied, let T be thisArg; else let T be undefined.
c. Let mapping be true
[...]
6. If usingIterator is not undefined, then
[...]
g. Repeat
[...]
vii. If mapping is true, then
1. Let mappedValue be Call(mapfn, T, «nextValue, k»).
2. If mappedValue is an abrupt completion, return
IteratorClose(iterator, mappedValue).
3. Let mappedValue be mappedValue.[[value]].
features: [Symbol.iterator]
--- |
2152 |
iter-map-fn-err.js |
---
esid: sec-array.from
description: Error invoking map function (traversed via iterator)
info: |
[...]
6. If usingIterator is not undefined, then
[...]
g. Repeat
[...]
vii. If mapping is true, then
1. Let mappedValue be Call(mapfn, T, «nextValue, k»).
2. If mappedValue is an abrupt completion, return
IteratorClose(iterator, mappedValue).
features: [Symbol.iterator]
--- |
1123 |
iter-map-fn-return.js |
---
esid: sec-array.from
description: Value returned by mapping function (traversed via iterator)
info: |
[...]
2. If mapfn is undefined, let mapping be false.
3. else
a. If IsCallable(mapfn) is false, throw a TypeError exception.
b. If thisArg was supplied, let T be thisArg; else let T be undefined.
c. Let mapping be true
[...]
6. If usingIterator is not undefined, then
[...]
g. Repeat
[...]
vii. If mapping is true, then
1. Let mappedValue be Call(mapfn, T, «nextValue, k»).
2. If mappedValue is an abrupt completion, return
IteratorClose(iterator, mappedValue).
3. Let mappedValue be mappedValue.[[value]].
features: [Symbol.iterator]
--- |
1984 |
iter-map-fn-this-arg.js |
---
esid: sec-array.from
description: >
`this` value of mapping function with custom `this` argument (traversed via iterator)
info: |
[...]
2. If mapfn is undefined, let mapping be false.
3. else
a. If IsCallable(mapfn) is false, throw a TypeError exception.
b. If thisArg was supplied, let T be thisArg; else let T be undefined.
c. Let mapping be true
[...]
6. If usingIterator is not undefined, then
[...]
g. Repeat
[...]
vii. If mapping is true, then
1. Let mappedValue be Call(mapfn, T, «nextValue, k»).
features: [Symbol.iterator]
--- |
1582 |
iter-map-fn-this-non-strict.js |
---
esid: sec-array.from
description: >
`this` value of mapping function in non-strict mode (traversed via iterator)
info: |
[...]
2. If mapfn is undefined, let mapping be false.
3. else
a. If IsCallable(mapfn) is false, throw a TypeError exception.
b. If thisArg was supplied, let T be thisArg; else let T be undefined.
c. Let mapping be true
[...]
6. If usingIterator is not undefined, then
[...]
g. Repeat
[...]
vii. If mapping is true, then
1. Let mappedValue be Call(mapfn, T, «nextValue, k»).
features: [Symbol.iterator]
flags: [noStrict]
--- |
1606 |
iter-map-fn-this-strict-strict.js |
---
esid: sec-array.from
description: >
`this` value of mapping function in strict mode (traversed via iterator)
info: |
[...]
2. If mapfn is undefined, let mapping be false.
3. else
a. If IsCallable(mapfn) is false, throw a TypeError exception.
b. If thisArg was supplied, let T be thisArg; else let T be undefined.
c. Let mapping be true
[...]
6. If usingIterator is not undefined, then
[...]
g. Repeat
[...]
vii. If mapping is true, then
1. Let mappedValue be Call(mapfn, T, «nextValue, k»).
features: [Symbol.iterator]
flags: [onlyStrict]
--- |
1558 |
iter-set-elem-prop-err.js |
---
esid: sec-array.from
description: Error setting property on result value (traversed via iterator)
info: |
[...]
6. If usingIterator is not undefined, then
[...]
g. Repeat
[...]
ix. Let defineStatus be CreateDataPropertyOrThrow(A, Pk,
mappedValue).
x. If defineStatus is an abrupt completion, return
IteratorClose(iterator, defineStatus).
features: [Symbol.iterator]
--- |
1368 |
iter-set-elem-prop-non-writable.js |
---
esid: sec-array.from
description: >
Non-writable properties are overwritten by CreateDataProperty.
(result object's "0" is non-writable, items is iterable)
info: |
Array.from ( items [ , mapfn [ , thisArg ] ] )
[...]
5. If usingIterator is not undefined, then
[...]
e. Repeat,
[...]
viii. Let defineStatus be CreateDataPropertyOrThrow(A, Pk, mappedValue).
[...]
features: [generators]
includes: [propertyHelper.js]
--- |
958 |
iter-set-elem-prop.js |
---
esid: sec-array.from
description: Setting property on result value (traversed via iterator)
info: |
[...]
6. If usingIterator is not undefined, then
[...]
g. Repeat
[...]
ix. Let defineStatus be CreateDataPropertyOrThrow(A, Pk,
mappedValue).
features: [Symbol.iterator]
--- |
1318 |
iter-set-length-err.js |
---
esid: sec-array.from
description: Error setting length of object (traversed via iterator)
info: |
[...]
6. If usingIterator is not undefined, then
[...]
g. Repeat
[...]
iv. If next is false, then
1. Let setStatus be Set(A, "length", k, true).
2. ReturnIfAbrupt(setStatus).
features: [Symbol.iterator]
--- |
1042 |
iter-set-length.js |
---
esid: sec-array.from
description: Setting length of object (traversed via iterator)
info: |
[...]
6. If usingIterator is not undefined, then
[...]
g. Repeat
[...]
iv. If next is false, then
1. Let setStatus be Set(A, "length", k, true).
2. ReturnIfAbrupt(setStatus).
3. Return A.
features: [Symbol.iterator]
--- |
1161 |
mapfn-is-not-callable-typeerror.js |
---
esid: sec-array.from
description: Throws a TypeError if mapFn is not callable
info: |
22.1.2.1 Array.from ( items [ , mapfn [ , thisArg ] ] )
...
2. If mapfn is undefined, let mapping be false.
3. else
a. If IsCallable(mapfn) is false, throw a TypeError exception.
...
--- |
1043 |
mapfn-is-symbol-throws.js |
---
esid: sec-array.from
description: Throws a TypeError if mapFn is not callable (Symbol)
info: |
22.1.2.1 Array.from ( items [ , mapfn [ , thisArg ] ] )
...
2. If mapfn is undefined, let mapping be false.
3. else
a. If IsCallable(mapfn) is false, throw a TypeError exception.
...
features:
- Symbol
--- |
607 |
mapfn-throws-exception.js |
---
description: mapFn throws an exception
esid: sec-array.from
es6id: 22.1.2.1
--- |
500 |
not-a-constructor.js |
---
esid: sec-ecmascript-standard-built-in-objects
description: >
Array.from does not implement [[Construct]], is not new-able
info: |
ECMAScript Function Objects
Built-in function objects that are not identified as constructors do not
implement the [[Construct]] internal method unless otherwise specified in
the description of a particular function.
sec-evaluatenew
...
7. If IsConstructor(constructor) is false, throw a TypeError exception.
...
includes: [isConstructor.js]
features: [Reflect.construct, arrow-function]
--- |
915 |
proto-from-ctor-realm.js |
---
esid: sec-array.from
es6id: 22.1.2.1
description: Default [[Prototype]] value derived from realm of the constructor
info: |
[...]
5. If usingIterator is not undefined, then
a. If IsConstructor(C) is true, then
i. Let A be ? Construct(C).
[...]
9.1.14 GetPrototypeFromConstructor
[...]
3. Let proto be ? Get(constructor, "prototype").
4. If Type(proto) is not Object, then
a. Let realm be ? GetFunctionRealm(constructor).
b. Let proto be realm's intrinsic object named intrinsicDefaultProto.
[...]
features: [cross-realm]
--- |
1038 |
shell.js |
|
0 |
source-array-boundary.js |
---
description: Source array with boundary values
esid: sec-array.from
es6id: 22.1.2.1
--- |
1448 |
source-object-constructor.js |
---
description: >
Array.from uses a constructor other than Array.
esid: sec-array.from
es6id: 22.1.2.1
--- |
441 |
source-object-iterator-1.js |
---
description: Source object has iterator which throws
esid: sec-array.from
es6id: 22.1.2.1
features: [Symbol.iterator]
--- |
746 |
source-object-iterator-2.js |
---
description: Source object has iterator
esid: sec-array.from
es6id: 22.1.2.1
features: [Symbol.iterator]
--- |
938 |
source-object-length-set-elem-prop-err.js |
---
esid: sec-array.from
description: >
TypeError is thrown if CreateDataProperty fails.
(items is not iterable)
info: |
Array.from ( items [ , mapfn [ , thisArg ] ] )
[...]
4. Let usingIterator be ? GetMethod(items, @@iterator).
5. If usingIterator is not undefined, then
[...]
6. NOTE: items is not an Iterable so assume it is an array-like object.
[...]
12. Repeat, while k < len
[...]
e. Perform ? CreateDataPropertyOrThrow(A, Pk, mappedValue).
[...]
CreateDataPropertyOrThrow ( O, P, V )
[...]
3. Let success be ? CreateDataProperty(O, P, V).
4. If success is false, throw a TypeError exception.
--- |
1307 |
source-object-length-set-elem-prop-non-writable.js |
---
esid: sec-array.from
description: >
Non-writable properties are overwritten by CreateDataProperty.
(result object's "0" is non-writable, items is not iterable)
info: |
Array.from ( items [ , mapfn [ , thisArg ] ] )
[...]
4. Let usingIterator be ? GetMethod(items, @@iterator).
5. If usingIterator is not undefined, then
[...]
6. NOTE: items is not an Iterable so assume it is an array-like object.
[...]
12. Repeat, while k < len
[...]
e. Perform ? CreateDataPropertyOrThrow(A, Pk, mappedValue).
[...]
includes: [propertyHelper.js]
--- |
1070 |
source-object-length.js |
---
description: >
Source is an object with length property and one item is deleted
from the source
esid: sec-array.from
es6id: 22.1.2.1
--- |
634 |
source-object-missing.js |
---
description: Source is an object with missing values
esid: sec-array.from
es6id: 22.1.2.1
--- |
603 |
source-object-without.js |
---
description: Source is an object without length property
esid: sec-array.from
es6id: 22.1.2.1
--- |
407 |
this-null.js |
---
esid: sec-array.from
es6id: 22.1.2.1
description: Does not throw if this is null
--- |
476 |