-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Functional notation? #2
Comments
Can the engine not invisibly lazily allocate the array? |
@ljharb Other lazy things that have been specified as such explicitly (e.g., the bound function in Intl methods) ended up not being implemented efficiently enough in some engines, and then libraries like Intl.js cached the result. I'd like to avoid this complexity in the future and do things more directly. Is a method that un-ergonomic here? |
Not that bad I think - but it's not an expensive operation, and I'd expect the result to be memoized - this seems like a lazy getter that replaces itself with a data property might be helpful? |
This just sounds really complicated. What's the issue with a method? |
I don't think it's a big issue; it just seems weird. |
Pre-allocating an additional object for each RegExp match, when existing code does not use it, is likely to have some performance cost. Would it be OK to instead have an
.offset()
method (orstart
andend
methods) on match objects, or is this too unergonomic?The text was updated successfully, but these errors were encountered: