arraylike-get-length-error.js |
9. Let len be ? LengthOfArrayLike(arrayLike). |
353 |
arraylike-to-length-error.js |
9. Let len be ? LengthOfArrayLike(arrayLike). |
361 |
calling-from-valid-1-noStrict.js |
|
829 |
calling-from-valid-1-onlyStrict-strict.js |
|
858 |
calling-from-valid-2.js |
|
865 |
descriptor.js |
|
268 |
elements-added-after.js |
|
526 |
elements-deleted-after.js |
|
543 |
from.js |
8.2.2.2 Tuple.from ( items [ , mapFn [, thisArg ] ] )
When the from method is called with argument items and optional arguments mapfn and thisArg, the following steps are taken:
1. If mapfn is undefined, let mapping be false.
2. Else,
a. If IsCallable(mapfn) is false, throw a TypeError exception.
b. Let mapping be true.
3. Let list be a new empty List.
4. Let k be 0.
5. Let usingIterator be ? GetMethod(items, @@iterator).
6. If usingIterator is not undefined, then
a. Let adder be a new Abstract Closure with parameters (key, value) that captures (list, mapFn, thisArg, mapping, k) and performs the following steps when called:
i. If mapping is true, then
1. Let mappedValue be ? Call(mapfn, thisArg, « value, k »).
ii. Else, let mappedValue be value.
iii. If Type(mappedValue) is Object, throw a TypeError exception.
iv. Append mappedValue to list.
v. Set k to k + 1.
b. Perform ! AddEntriesFromIterable(undefined, iterable, adder).
c. Return a new Tuple value whose [[Sequence]] is list.
7. NOTE: items is not an Iterable so assume it is an array-like object.
8. Let arrayLike be ! ToObject(items).
9. Let len be ? LengthOfArrayLike(arrayLike).
10. Repeat, while k < len,
a. Let Pk be ! ToString(k).
b. Let kValue be ? Get(arrayLike, Pk).
c. If mapping is true, then
i. Let mappedValue be ? Call(mapfn, thisArg, « kValue, k »).
d. Else, let mappedValue be kValue.
e. If Type(mappedValue) is Object, throw a TypeError exception.
f. Append mappedValue to list.
g. Set k to k + 1.
11. Return a new Tuple value whose [[Sequence]] is list.
|
3590 |
get-iter-method-err.js |
|
313 |
indexed-setters.js |
|
323 |
items-is-arraybuffer.js |
|
180 |
items-is-null-throws.js |
|
189 |
iter-adv-err.js |
|
314 |
iter-get-iter-err.js |
|
347 |
iter-get-iter-val-err.js |
|
518 |
iter-map-fn-args.js |
|
808 |
iter-map-fn-err.js |
|
497 |
iter-map-fn-return.js |
|
873 |
iter-map-fn-this-arg.js |
|
640 |
iter-map-fn-this-non-strict.js |
|
656 |
iter-map-fn-this-strict-strict.js |
|
630 |
iter-next-error.js |
Step 6b. |
394 |
iter-next-value-error.js |
Step 6b. |
555 |
iter-set-elem-prop.js |
|
693 |
iter-set-length.js |
|
554 |
length.js |
|
419 |
mapfn-is-not-callable-typeerror.js |
|
442 |
mapfn-throws-exception.js |
|
313 |
name.js |
|
266 |
not-a-constructor.js |
|
239 |
prop-desc.js |
|
268 |
source-array-boundary.js |
|
623 |
source-object-iterator-1.js |
|
517 |
source-object-length.js |
|
273 |
source-object-without.js |
|
170 |
this-null.js |
|
365 |