tc39 / proposal-joint-iteration

a TC39 proposal to synchronise the advancement of multiple iterators
https://tc39.es/proposal-joint-iteration
70 stars 2 forks source link

fixes #22: don't coerce padding option #23

Closed michaelficarra closed 5 months ago

michaelficarra commented 5 months ago

Fixes #22. /cc @bakkot

bakkot commented 5 months ago

What I meant was actually the case in zipToObjects, where we do

i. For each element key of keys, do
  1. Let value be Completion(Get(paddingOption, key)).
  2. IfAbruptCloseIterators(value, iters).
  3. Append value to padding.

without first having checked that paddingOption is an object. (That's actually an editorial error because Get only works on objects.)


With regards to this change, we didn't get to consensus on the question of whether iterable-taking things should reject strings, so we don't formally have guidance here. I could go either way.

As written this change also has the effect of allowing bare iterators which lack a Symbol.iterator. I don't think we should do that, the same way we don't for the iterables argument.

michaelficarra commented 5 months ago

@bakkot Thanks. Opened an alternative: https://github.com/tc39/proposal-joint-iteration/pull/24