archives

« Bugzilla Issues Index

#2440 — 12.1.4.2.5 Evaluation: Missing runtime evaluation semantics for "Comprehension" production


12.1.4.2.5 Runtime Semantics: Evaluation.

The evaluation semantics for "Comprehension" are missing, these are required for evaluating generator comprehensions.

See:
- 14.4.11 Runtime Semantics: EvaluateBody "GeneratorBody : Comprehension"
- 25.3.3.1 GeneratorStart (generator, generatorBody), step 4a

Step 4a of GeneratorStart cannot be executed without a corresponding "Runtime Semantics: Evaluation" for Comprehension.


The concrete steps should look like:
---
1. Let status be the result of performing ComprehensionEvaluation for Comprehension with argument `undefined`.
2. ReturnIfAbrupt(status).
3. Return NormalCompletion(undefined).
---


Fixed in rev23 editor's draft.

Note that steps 2 and 3 of the suggested fix are unnecessary because ComprehensionComponentEvaluation for ComprehensionFor takes care of producing the normal completion of undefined. The version I put in the spec just returns the ComprehensionEvaluation result.


fixed in rev23 draft