Ecma262: Incorrect assertion in ForIn/OfHeadEvaluation

Created on 13 Dec 2019  路  4Comments  路  Source: tc39/ecma262

https://tc39.es/ecma262/#sec-runtime-semantics-forin-div-ofheadevaluation-tdznames-expr-iterationkind

Steps 7.a-b. say:

a. Assert: iterationKind is iterate.
b. If iterationKind is async-iterate, let iteratorHint be async.

The assertion rules out the condition on the next line.

good first patch spec bug

Most helpful comment

or else changed to: Assert: _iterationKind_ is ~iterate~ or ~async-iterate~.

All 4 comments

The implication is that the assertion should have been removed in #1066.

or else changed to: Assert: _iterationKind_ is ~iterate~ or ~async-iterate~.

Good call, that seems better.

Or changed to:

  1. If iterationKind is ~async-iterate~, then let iteratorHint be ~async~.
  2. Else,
    1. Assert: iterationKind is ~iterate~.
    2. Let iteratorHint be ~sync~.
1. If _iterationKind_ is ~async-iterate~, then let _iteratorHint_ be ~async~.
1. Else,
    1. Assert: _iterationKind_ is ~iterate~.
    1. Let _iteratorHint_ be ~sync~.

This is used in ValidateAndApplyPropertyDescriptor 搂 Step 2.d.

Was this page helpful?
0 / 5 - 0 ratings