Spec issues & errata · defect of the text · docs/spec-issues/68-weakref-cells-and-unicode-sorts.md
68. WeakRef execution single-cell loop, SuspendThisAgent's NotifyWaiter argument, "Canonical property value" column, and metamodel sort gaps
- Location
- §9.9.3 Execution (
#sec-weakref-execution), step 1.b; §25.4.3.11 SuspendThisAgent (#sec-suspendthisagent), step 7, against §25.4.3.12 NotifyWaiter (#sec-notifywaiter); §22.2.2.9.8 UnicodeMatchPropertyValue (#sec-runtime-semantics-unicodematchpropertyvalue-p-v), step 3; §16.2.1.5 Abstract Module Records (#sec-abstract-module-records). - Kind
- quantification bug, parameter-type mismatch, nonexistent UCD column header, and stale subclass/sort prose.
- Model erratum
WeakRefAllCellsAndSuspendWaiter, baked-in SpecTec reading proposed (Collected/Cell.Emptiedinspec/spectec/prose/25-host-laws-changes.spectec,$SuspendAgentUntilin00-decls.spectec,$CanonicalPropertyValueinS22.spectec, andsuper [#"Module Record"]on#"Synthetic Module Record"in00-decls.spectec).- Upstream
- Checked 2026-11-19: issue #3328 (open, 2024-05), "Typo in step 7 of the SuspendThisAgent abstract operation", reports the
NotifyWaiterparameter bug; none found for theFinalizationRegistrysingle-cell loop, the"Canonical property value"column, orAbstract Module RecordsomittingSynthetic Module Record(searched for "Canonical property value" and "sole concrete subclass Source Text Module Record"). - On this site
WeakRefAllCellsAndSuspendWaiteron Spec issues & errata (defect of the text; SpecTec bakes in the proposed reading)
Text
§9.9.3 (Execution):
b. For each FinalizationRegistry finalizationRegistry such that finalizationRegistry.[[Cells]] contains a Record cell such that cell.[[WeakRefTarget]] is value, do
i. Set cell.[[WeakRefTarget]] to empty.
SuspendThisAgent:
7. Perform LeaveCriticalSection(waiterList) and suspend the surrounding agent until the time is waiterRecord.[[TimeoutTime]], performing the combined operation in such a way that a notification that arrives after the critical section is exited but before the suspension takes effect is not lost. The surrounding agent can only wake from suspension due to a timeout or due to another agent calling NotifyWaiter with arguments waiterList and thisAgent (i.e. via a call to
Atomics.notify).
UnicodeMatchPropertyValue:
3. Let value be the canonical property value of v as given in the “Canonical property value” column of the corresponding row.
§16.2.1.5 (Abstract Module Records):
This specification defines the abstract subclass named Cyclic Module Record and its concrete subclass named Source Text Module Record.
Problem
Four prose-vs-signature defects where SpecTec bakes in a non-literal fix:
FinalizationRegistryduplicate target cells (§9.9.3 step 1.b). Step 1.b iterates once per FinalizationRegistry and binds a single_cell_, leaving duplicate registrations for the same target (fr.register(o, 1); fr.register(o, 2)) un-emptied! SpecTec'sCell.Emptied(25-host-laws-changes.spectec) empties every matching cell Record.SuspendThisAgentstep 7 (#3328)._thisAgent_isAgentSignifier(), whereasNotifyWaiterrequires aWaiter Record(_waiterRecord_). SpecTec's$SuspendAgentUntiland$WakeAgentmatch viaWaiter Record.- Nonexistent
"Canonical property value"column (§22.2.2.9.8 step 3). UCDPropertyValueAliases.txtis a headerless semicolon-delimited file with no"Canonical property value"column (a copy-paste fromUnicodeMatchPropertystep 3's"Canonical property name"column), and bothUnicodeMatchPropertyandUnicodeMatchPropertyValuedeclare undefined return sorts while returninga List of Unicode code points. SpecTec's$CanonicalPropertyValueselects field 3 (the long property value name). Abstract Module RecordsomittingSynthetic Module Record(§16.2.1.5). §16.2.1.5 states "This specification defines the abstract subclass named Cyclic Module Record and its concrete subclass named Source Text Module Record", overlookingSynthetic Module Record(§16.2.1.8, used for JSON modules —00-decls.spectecdeclaressuper [#"Module Record"]on#"Synthetic Module Record").
Examples
print(/\p{gc=Lu}/u.test("A"), /\p{General_Category=Uppercase_Letter}/u.test("A"));
/\p{gc=Lu}/u.test("A") |
|
|---|---|
| literal §22.2.2.9.8 step 3 | references nonexistent "Canonical property value" column |
| V8, SpiderMonkey, JavaScriptCore | true |
| formal model (proposed reading) | true |
Proposed wording
In §9.9.3 step 1.b iterate over every matching _cell_ in _finalizationRegistry_.[[Cells]]; in SuspendThisAgent
step 7 replace _thisAgent_ with _waiterRecord_; in UnicodeMatchPropertyValue step 3 name the third (long value)
field of PropertyValueAliases.txt and return a List of Unicode code points; and in §16.2.1.5 list Synthetic Module
Record alongside Cyclic Module Record.
test262
built-ins/RegExp/property-escapes/ exercises UnicodeMatchPropertyValue, language/import/import-attributes/ tests
JSON Synthetic Module Records, and built-ins/FinalizationRegistry/ tests multiple cell registrations.