From 808af176fc6b2a63bf4a5df110c8296de402d60b Mon Sep 17 00:00:00 2001 From: Richard Gibson Date: Tue, 28 Jul 2026 10:25:48 -0400 Subject: [PATCH] Editorial: Prepare Annex B for ecmarkup linting (#3932) Ref https://github.com/tc39/ecmarkup/pull/716 - Try for more consistency in the Annex B SDO modifications - Use INS tags to highlight Annex B ParsePattern modifications like we already do for Regular Expression Early Errors --- spec.html | 54 ++++++++++++++++++++++++++++++------------------------ 1 file changed, 30 insertions(+), 24 deletions(-) diff --git a/spec.html b/spec.html index 662ff3710b5..8c92583aa70 100644 --- a/spec.html +++ b/spec.html @@ -54163,7 +54163,7 @@

Static Semantics: CountLeftCapturingParensWithin and CountLeftCapturingParen

Static Semantics: IsCharacterClass

-

The semantics of is extended as follows:

+

The semantics of IsCharacterClass is extended as follows:

ClassAtomNoDash :: `\` [lookahead == `c`] @@ -54174,7 +54174,7 @@

Static Semantics: IsCharacterClass

Static Semantics: CharacterValue

-

The semantics of is extended as follows:

+

The semantics of CharacterValue is extended as follows:

ClassAtomNoDash :: `\` [lookahead == `c`] @@ -54195,8 +54195,7 @@

Static Semantics: CharacterValue

Runtime Semantics: CompileSubpattern

-

The semantics of CompileSubpattern is extended as follows:

- +

The semantics of CompileSubpattern with arguments _regexpRecord_ and _direction_ is extended as follows:

The rule for Term :: QuantifiableAssertion Quantifier is the same as for Term :: Atom Quantifier but with |QuantifiableAssertion| substituted for |Atom|.

The rule for Term :: ExtendedAtom Quantifier is the same as for Term :: Atom Quantifier but with |ExtendedAtom| substituted for |Atom|.

The rule for Term :: ExtendedAtom is the same as for Term :: Atom but with |ExtendedAtom| substituted for |Atom|.

@@ -54204,12 +54203,16 @@

Runtime Semantics: CompileSubpattern

Runtime Semantics: CompileAssertion

-

CompileAssertion rules for the Assertion :: `(?=` Disjunction `)` and Assertion :: `(?!` Disjunction `)` productions are also used for the |QuantifiableAssertion| productions, but with |QuantifiableAssertion| substituted for |Assertion|.

+

The semantics of CompileAssertion with argument _regexpRecord_ is extended as follows:

+

The rule for QuantifiableAssertion :: `(?=` Disjunction `)` is the same as for Assertion :: `(?=` Disjunction `)` but with |QuantifiableAssertion| substituted for |Atom|.

+

The rule for QuantifiableAssertion :: `(?!` Disjunction `)` is the same as for Assertion :: `(?!` Disjunction `)` but with |QuantifiableAssertion| substituted for |Atom|.

Runtime Semantics: CompileAtom

-

CompileAtom rules for the |Atom| productions except for Atom :: PatternCharacter are also used for the |ExtendedAtom| productions, but with |ExtendedAtom| substituted for |Atom|. The following rules, with parameter _direction_, are also added:

+

The semantics of CompileAtom with arguments _regexpRecord_ and _direction_ is extended as follows:

+

Rules for the |Atom| productions except for Atom :: PatternCharacter are also used for the |ExtendedAtom| productions, but with |ExtendedAtom| substituted for |Atom|.

+

The following rules are also added:

ExtendedAtom :: `\` [lookahead == `c`] 1. Let _charSet_ be the CharSet containing the single character `\\` U+005C (REVERSE SOLIDUS). @@ -54225,9 +54228,8 @@

Runtime Semantics: CompileAtom

Runtime Semantics: CompileToCharSet

-

The semantics of is extended as follows:

- -

The following two rules replace the corresponding rules of CompileToCharSet.

+

The semantics of CompileToCharSet with argument _regexpRecord_ is extended as follows:

+

Two rules are replaced:

NonemptyClassRanges :: ClassAtom `-` ClassAtom ClassContents 1. Let _charSet_ be CompileToCharSet of the first |ClassAtom| with argument _regexpRecord_. @@ -54244,8 +54246,7 @@

Runtime Semantics: CompileToCharSet

1. Let _rangeSet_ be CharacterRangeOrUnion(_regexpRecord_, _charSet_, _otherSet_). 1. Return the union of _rangeSet_ and _remainingSet_.
- -

In addition, the following rules are added to CompileToCharSet.

+

The following rules are also added:

ClassEscape :: `c` ClassControlLetter 1. Let _charValue_ be the CharacterValue of this |ClassEscape|. @@ -54281,8 +54282,7 @@

Static Semantics: ParsePattern ( _patternText_, _u_, _v_ )

-

The semantics of is extended as follows:

-

The abstract operation ParsePattern takes arguments _patternText_ (a sequence of Unicode code points), _u_ (a Boolean), and _v_ (a Boolean). It performs the following steps when called:

+

The semantics of ParsePattern with arguments _patternText_, _u_, and _v_ is extended as follows, with modifications highlighted:

1. If _v_ is *true* and _u_ is *true*, then 1. Let _parseResult_ be a List containing one or more *SyntaxError* objects. @@ -54291,8 +54291,8 @@

Static Semantics: ParsePattern ( _patternText_, _u_, _v_ )

1. Else if _u_ is *true*, then 1. Let _parseResult_ be ParseText(_patternText_, |Pattern[+UnicodeMode, ~UnicodeSetsMode, +NamedCaptureGroups]|). 1. Else, - 1. Let _parseResult_ be ParseText(_patternText_, |Pattern[~UnicodeMode, ~UnicodeSetsMode, ~NamedCaptureGroups]|). - 1. If _parseResult_ is a Parse Node and _parseResult_ contains a |GroupName|, then + 1. Let _parseResult_ be ParseText(_patternText_, |Pattern[~UnicodeMode, ~UnicodeSetsMode, ~NamedCaptureGroups]|). + 1. If _parseResult_ is a Parse Node and _parseResult_ contains a |GroupName|, then 1. Set _parseResult_ to ParseText(_patternText_, |Pattern[~UnicodeMode, ~UnicodeSetsMode, +NamedCaptureGroups]|). 1. Return _parseResult_.
@@ -54630,9 +54630,8 @@

Date.prototype.setYear ( _year_ )

1. Let _dateObj_ be the *this* value. 1. Perform ? RequireInternalSlot(_dateObj_, [[DateValue]]). 1. Let _time_ be _dateObj_.[[DateValue]]. - 1. Let _year_ be ? ToNumber(_year_). 1. If _time_ is *NaN*, set _time_ to *+0*𝔽; else set _time_ to LocalTime(_time_). - 1. Let _fullYear_ be MakeFullYear(_year_). + 1. Let _fullYear_ be MakeFullYear(? ToNumber(_year_)). 1. Let _day_ be MakeDay(_fullYear_, 𝔽(MonthFromTime(_time_)), 𝔽(DateFromTime(_time_))). 1. Let _date_ be MakeDate(_day_, 𝔽(TimeWithinDay(_time_))). 1. Let _utcTimestamp_ be TimeClip(UTC(_date_)). @@ -54784,22 +54783,26 @@

Initializers in ForIn Statement Heads

`for` `(` `var` BindingIdentifier[?Yield, ?Await] Initializer[~In, ?Yield, ?Await] `in` Expression[+In, ?Yield, ?Await] `)` Statement[?Yield, ?Await, ?Return]

This production only applies when parsing non-strict code.

-

The static semantics of ContainsDuplicateLabels in are augmented with the following:

+ +

The static semantics of ContainsDuplicateLabels with argument _labelSet_ are augmented with the following:

ForInOfStatement : `for` `(` `var` BindingIdentifier Initializer `in` Expression `)` Statement 1. Return ContainsDuplicateLabels of |Statement| with argument _labelSet_. -

The static semantics of ContainsUndefinedBreakTarget in are augmented with the following:

+ +

The static semantics of ContainsUndefinedBreakTarget with argument _labelSet_ are augmented with the following:

ForInOfStatement : `for` `(` `var` BindingIdentifier Initializer `in` Expression `)` Statement 1. Return ContainsUndefinedBreakTarget of |Statement| with argument _labelSet_. -

The static semantics of ContainsUndefinedContinueTarget in are augmented with the following:

+ +

The static semantics of ContainsUndefinedContinueTarget with arguments _iterationSet_ and _labelSet_ are augmented with the following:

ForInOfStatement : `for` `(` `var` BindingIdentifier Initializer `in` Expression `)` Statement 1. Return ContainsUndefinedContinueTarget of |Statement| with arguments _iterationSet_ and « ». -

The static semantics of IsDestructuring in are augmented with the following:

+ +

The static semantics of IsDestructuring are augmented with the following:

BindingIdentifier : Identifier @@ -54809,21 +54812,24 @@

Initializers in ForIn Statement Heads

1. Return *false*. -

The static semantics of VarDeclaredNames in are augmented with the following:

+ +

The static semantics of VarDeclaredNames are augmented with the following:

ForInOfStatement : `for` `(` `var` BindingIdentifier Initializer `in` Expression `)` Statement 1. Let _names1_ be the BoundNames of |BindingIdentifier|. 1. Let _names2_ be the VarDeclaredNames of |Statement|. 1. Return the list-concatenation of _names1_ and _names2_. -

The static semantics of VarScopedDeclarations in are augmented with the following:

+ +

The static semantics of VarScopedDeclarations are augmented with the following:

ForInOfStatement : `for` `(` `var` BindingIdentifier Initializer `in` Expression `)` Statement 1. Let _decls1_ be « |BindingIdentifier| ». 1. Let _decls2_ be the VarScopedDeclarations of |Statement|. 1. Return the list-concatenation of _decls1_ and _decls2_. -

The runtime semantics of ForInOfLoopEvaluation in are augmented with the following:

+ +

The runtime semantics of ForInOfLoopEvaluation with argument _labelSet_ are augmented with the following:

ForInOfStatement : `for` `(` `var` BindingIdentifier Initializer `in` Expression `)` Statement 1. Let _bindingId_ be the StringValue of |BindingIdentifier|.