Skip to content

Commit 7ca3452

Browse files
authored
explainer: Fix badCallback example, throws only if iterable has items (#15)
In order to match the current specification and to be consistent with Array.from. `Array.from([], ()=>{throw 1})` will not throw but `Array.from([1], ()=>{throw 1})` will.
1 parent 16d4c77 commit 7ca3452

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ Array.fromAsync(badIterable);
187187
Array.fromAsync(genError());
188188
Array.fromAsync(genRejection());
189189
Array.fromAsync(genErrorAsync());
190-
Array.fromAsync([], badCallback);
190+
Array.fromAsync([1], badCallback);
191191
BadConstructor.call(Array.fromAsync, []);
192192
// These create promises that will reject with TypeErrors.
193193
Array.fromAsync(null);

0 commit comments

Comments
 (0)