archives

« Bugzilla Issues Index

#3231 — 7.3.11, 7.3.12, 19.1.2.1, 19.1.2.3.1: Different placeholder for pendingException


7.3.11 SetIntegrityLevel (O, level)
7.3.12 TestIntegrityLevel (O, level)
19.1.2.1 Object.assign ( target, ...sources )
19.1.2.3.1 Runtime Semantics: ObjectDefineProperties Abstract Operation


`undefined` as a placeholder for `pendingException` seems to confuse readers, it's unclear to them whether `undefined` is the ECMAScript value `undefined` or should be treated as a standalone value like `empty`. This issue often arises when implementing the algorithms in ECMAScript code (sketched as options A and B below).


A) `undefined` as the ECMAScript value `undefined`:
---
var pendingException = undefined;
for (...) {
try {
...
} catch (e) {
if (pendingException === undefined) {
pendingException = e;
}
}
}
if (pendingException !== undefined) {
throw pendingException;
}
---


B) `undefined` as a standalone value:
---
var pendingException;
var hasPendingException = false;
for (...) {
try {
...
} catch (e) {
if (!hasPendingException) {
hasPendingException = true;
pendingException = e;
}
}
}
if (hasPendingException) {
throw pendingException;
}
---


fixed in rev28 editor's draft

now use 'empty' to indicate "no pendingExeption value"


fixed in rev28