-
-
Notifications
You must be signed in to change notification settings - Fork 402
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
String.replace(regexp|substr, newSubstr|function) #116
Comments
Hey mate, can I have a go of this? |
@louisgjohnson: still working on this? I would like to help with it. |
@jasonwilliams I think this is already added (as I understand from the discussions) |
@jasonwilliams you implemented this in #217, but as I noted in #629 , there is a bug with the current implementation: > let str = 'boa';
> str.replace(/.*/, "??$&??")
"??boa??"
> str.replace(".*", "??$&??")
"boa" While on Looking at the spec: https://tc39.es/ecma262/#sec-string.prototype.replace After #629 gets merged I'd like to look into implementing |
Closing, as the bug that blocked this is solved. If we overlooked something we can open another issue with the specific problem. |
replace
function would need to be added to the string object here:https://github.com/jasonwilliams/boa/blob/master/src/lib/js/string.rs
It would be very similar to:
https://github.com/jasonwilliams/boa/blob/master/src/lib/js/regexp.rs#L212-L251
Spec:
https://tc39.es/ecma262/#sec-string.prototype.replace
Notes:
https://github.com/jasonwilliams/boa/blob/master/docs/debugging.md
The text was updated successfully, but these errors were encountered: