Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Remove XRegExp.prototype.apply/call? #13

slevithan opened this Issue · 2 comments

1 participant


Back story:

XRegExp 0.5.0 added the methods RegExp.prototype.apply/call. XRegExp 2.0.0-beta moved them to XRegExp.prototype, added XRegExp.install('methods') to copy them back to RegExp.prototype, and made XRegExp(regexp)/XRegExp.globalize augment copied regexes with apply and call methods.

Going forward:

I'm considering removing the regex apply and call methods altogether in XRegExp 2.0.0 final. Since the built-in array collection methods (such as Array.prototype.filter) don't use duck-typed apply or call, adding these methods to regexes just doesn't seem useful often enough to justify them.


Brendan Eich recently referenced XRegExp's callable regexes on es-discuss. That and various other comments / blogs across the web show there is some (small) interest in callable regexes.

(A scenario where I've used callable regexes in the past is validation methods that can be extended with functions and/or regexes that are passed in.)


I've moved the XRegExp.prototype.apply/call methods to the new XRegExp Prototype Methods addon.

@slevithan slevithan closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.