Closed pgilad closed 8 years ago
We have implemented the internals of named capture groups in V8. I don't think this is a big performance concern for us. It would be hard to unambiguously specify what the semantics are in such a case (which is generally required if JS features).
We have implemented the internals of named capture groups in V8.
For future reference, the patch @littledan mentioned is here: https://codereview.chromium.org/2050343002
I’ve created a tracking issue for future updates in V8: https://bugs.chromium.org/p/v8/issues/detail?id=5437
Why?
Performance. If the engine needs to validate there are no duplicate keys it has some overhead. Definitely in hot areas. I suggest that the last named capture group would win.
Maintaining unique names should be purely left to the end-user to take care of (or not for some use cases)