Home | History | Annotate | Download | only in src

Lines Matching refs:replace

202 function StringReplace(search, replace) {
207 %_Log('regexp', 'regexp-replace,%0r,%1S', [search, subject]);
208 if (IS_FUNCTION(replace)) {
209 return StringReplaceRegExpWithFunction(subject, search, replace);
211 return StringReplaceRegExp(subject, search, replace);
225 // Compute the string to replace with.
226 if (IS_FUNCTION(replace)) {
227 builder.add(replace.call(null, search, start, subject));
231 replace = TO_STRING_INLINE(replace);
232 ExpandReplacement(replace, subject, reusableMatchInfo, builder);
242 // Helper function for regular expressions in String.prototype.replace.
243 function StringReplaceRegExp(subject, regexp, replace) {
244 replace = TO_STRING_INLINE(replace);
247 replace,
373 // function application in String.prototype.replace. The function application
377 // 'abcd'.replace(/(.)/g, function() { return RegExp.$1; }
379 function StringReplaceRegExpWithFunction(subject, regexp, replace) {
399 result.add(replace.call(null, match, startOfMatch, subject));
401 result.add(ApplyReplacementFunction(replace, matchInfo, subject));
430 result.add(ApplyReplacementFunction(replace, matchInfo, subject));
441 function ApplyReplacementFunction(replace, matchInfo, subject) {
443 // and subject for the replace function invocation.
450 return replace.call(null, s, index, subject);
458 return replace.apply(null, parameters);
742 return TO_STRING_INLINE(str).replace(/</g, "&lt;")
743 .replace(/>/g, "&gt;")
744 .replace(/"/g, "&quot;")
745 .replace(/'/g, "&#039;");
882 "replace", StringReplace,