10:56
<Aapo Alasuutari>
i mean it’s a data property, not sure that’s where I’d draw the silly line personally

I mean, it's an unconfigurable, unenumerable but writable property that mostly assumes you're only writing integers into it, but allows you to write anything whatsoever into it and then observe that write going through. If you were to define RegExp today, I would assume you'd use a setter kind of system that coerces to integer during writing instead of like it works now where coercion happens when the value gets used.

I definitely think it's silly :)

17:25
<bakkot>
if we were to define it today there would not be a mutable lastIndex property on regexps because that is an insane thing to exist
17:26
<bakkot>
but given the current design, the coercion (or at least validation) needs to happen on read rather than on write because you can make your own totally bespoke regexps and the machinery has to be tolerant of your bespoke regexp having a non-integral lastIndex
17:30
<Andreu Botella>
surely everyone agrees that thenables and matchables are a great idea