tc39 / proposal-regex-escaping

Proposal for investigating RegExp escaping for the ECMAScript standard
http://tc39.es/proposal-regex-escaping/
Creative Commons Zero v1.0 Universal
363 stars 32 forks source link

Path to Stage 4! #58

Open ljharb opened 11 months ago

ljharb commented 11 months ago

Stage 4

~Stage 3~

~Stage 2.7~

~Stage 2~

~Stage 1~

ljharb commented 3 months ago

Thanks; that’s a spec bug that we’ll fix but doesnt affect semantics obv.

Sure, we can discuss it in plenary - hopefully either outcome can still allow for advancement in that meeting, given that the effective behavior is the same.

The changing nature of whitespace holds for regexes themselves as well as the trim methods, none of which have a note - what do you suggest?

gibson042 commented 3 months ago

Sure, we can discuss it in plenary - hopefully either outcome can still allow for advancement in that meeting, given that the effective behavior is the same.

:+1:

The changing nature of whitespace holds for regexes themselves as well as the trim methods, none of which have a note - what do you suggest?

I think it's more obvious for those cases, especially when it comes to \s and \S in patterns... that the behavior of something like RegExp.escape may not be stable over time is surprising. But I agree with you that it is also true of other operations, and have opened https://github.com/tc39/ecma262/issues/3331 accordingly. This proposal can either track that or try to anticipate it; either approach seems fine to me.

ljharb commented 3 months ago

It will be quite stable in terms of "how it behaves in regexes" - nobody should be noticing or caring about the stability of the string it produces otherwise :-)

michaelficarra commented 3 months ago

@ljharb Wouldn't that be nice? Unfortunately, we both know how this job goes. If it can be observed, someone will observe it, and it must eventually become stable and compatible across engines.

ljharb commented 3 months ago

@michaelficarra that is true, and yet we've changed the whitespace value in JS multiple times and the only place it seemed to break people is in my projects' test cases :-p

@gibson042 filed #78 to address the first bullet point.

ljharb commented 3 months ago

Consensus today on character escapes and stage 2.7.

Help writing test262 tests is much appreciated :-)

leobalter commented 2 months ago

I wrote something https://github.com/tc39/test262/pull/4123

ljharb commented 1 month ago

This proposal reached stage 3 today. https://twitter.com/ljharb/status/1817996611462500574

oliverfoster commented 1 month ago

Congratulations on getting to Stage 3. Well deserved. 👍