Recent betas have introduced a bidi-related problem with register processing.

In the following example, compilation generates a recoverable error when register processing has to trim an entry to fit maxwidth. The error is:

luatex warning  > node filter: error: ...eXt/tex/texmf-context/tex/context/base/mkiv/typo-dub.lua:496: attempt to index local 'stacktop' (a nil value)

Removing the maxwidth constraint, or setting it to a much wider value, allows error-free compilation.

Without \setupdirections[bidi=on,method=two] there is no problem, but without it RTL texts are not handled properly. This is a recent change; bidi=global worked a few months ago. (I have not tried with LTR text in a default-RTL document).

% macros=mkvi
\defineregister[Mindex]
\setupregister [Mindex]
               [n=2,
                maxwidth=4cm,
                balance=no]

\starttexdefinition unexpanded MIndex
  \dosinglegroupempty\doMIndex
\stoptexdefinition

\starttexdefinition unexpanded doMIndex #MARKER
  \def\Marker{#MARKER}%
  \dosinglegroupempty\doMIndexFull
\stoptexdefinition

\starttexdefinition doMIndexFull #ITEM
  \doifelse{#ITEM}{}
    {\expanded{\Mindex{\Marker}}}
    {\expanded{\Mindex{\Marker+#ITEM}}}
\stoptexdefinition

\setupdirections [bidi=on,method=two]

\setupbodyfont   [libertinus,11pt]

\starttext

\startparagraph
  \MIndex{One}{Mairzy doats and dozy doats and liddle lamzy divey}

  \input jojomayer 

\stopparagraph

\startparagraph
סלאם שלום
\stopparagraph

\placeregister[Mindex]
\stoptext

--
Rik Kabel