]> git.kaiwu.me - njs.git/commit
Fixed String.prototype.replace() with replacement containing "$'", "$`".
authorDmitry Volyntsev <xeioex@nginx.com>
Wed, 8 Mar 2023 04:51:45 +0000 (20:51 -0800)
committerDmitry Volyntsev <xeioex@nginx.com>
Wed, 8 Mar 2023 04:51:45 +0000 (20:51 -0800)
commit485b3657f288209d894389ff75285c747cecf08e
tree24513f739e131b030996c0e9532fd368e8a4ccae
parent363bc64968ee5a94763157ebfbaeb7930addb8c9
Fixed String.prototype.replace() with replacement containing "$'", "$`".

Previously, the resulting string was might be broken when the string to
replace and the search string were UTF-8.  pos is always a character
offset, it should not be directly used as a byte size or offset.
src/njs_string.c
src/test/njs_unit_test.c