-
Notifications
You must be signed in to change notification settings - Fork 30.4k
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
Unexpected semantics for util.is... #2197
Comments
The semantics almost certainly won't change. It is suggested you don't use these functions; I've been meaning to put deprecation notices into the docs. How do you suggest we clarify that that won't work? For posterity, the internals use |
See also #2201 |
Anyway -
ES6 allows to create classes extending RegExps, but it isn't implemented in any engine yet. |
@Fishrock123 thanks. I think the deprecation notice is a fine solution. I'm not sure if it helps, but saying that the function returns true for objects created with the |
The semantics for the util
is...
functions are somewhat unexpected. For example, the documentation forutil.isRegExp
says:But I'm seeing that
util.isRegExp(Object.create(RegExp.prototype)) === false
.Can we clarify the documentation to explain why this is not a RegExp or change the semantics of isRegExp please? (Same goes with the other
is
functions.) Thanks.The text was updated successfully, but these errors were encountered: