archives

« Bugzilla Issues Index

#3489 — 21.2.5.2.2 Combine Get + ToLength in RegExpBuiltinExec


In the algorithm:

4. Let lastIndex be Get(R,"lastIndex").
5. Let i be ToLength(lastIndex).
6. ReturnIfAbrupt(i).

can be shortened to:

4. Let lastIndex be ToLength(Get(R,"lastIndex")).
5. ReturnIfAbrupt(lastIndex).

with s/i/lastIndex/ for the rest of the algorithm.

The shortened form also effectively covers the Get(R, "lastIndex") in the ReturnIfAbrupt (whereas the initial form is missing a "ReturnIfAbrupt(lastIndex)" at 4.5ish)

elsewhere (even in the same algorithm) these two steps are combined, e.g.:

7. Let global be ToBoolean(Get(R, "global")).
8. ReturnIfAbrupt(global).


fixed in rev31 editor's draft


In Rev31