archives

« Bugzilla Issues Index

#4337 — Annex E: Completion reform changes


Annex E:

- Completion reform for If-Statements not listed.




- Text for SwitchStatement incorrect:
---
[...] if the last evaluated CaseClause or
DefaultClause produces a normal completion whose value is empty, the completion value of the SwitchStatement is undefined.
---

Example:
---
switch (0) {
case 0:
1; // fall-thru
case 1:
; // empty statement
}
---

Last evaluated CaseClause is "case 1: ;", completion value is empty, but SwitchStatement completion value is "1" (not undefined!).




- Minor issue:
---
In ECMAScript 2015, the normal completion value of a XXXStatement is never the value empty.
---
where XXXStatement is IterationStatement, SwitchStatement or TryStatement.

The completion value is even non-empty for abrupt completions:




- Text for TryStatement incorrect when Finally block is present:
---
If the Block part of a TryStatement evaluates to a throw completion and it has a
Catch part that evaluates to a normal completion whose value is empty, the completion value of the TryStatement is undefined.
---

Example:
---
try {
throw null;
} catch (e) {
; // empty
} finally {
return 123;
}


fixed in rev39 publication draft