Lines Matching refs:replace
194 function StringReplace(search, replace) { argument
222 if (!IS_SPEC_FUNCTION(replace)) {
223 replace = TO_STRING_INLINE(replace);
232 if (replace.length == 0) {
236 return ExpandReplacement(replace, subject, lastMatchInfo,
245 subject, search, replace, lastMatchInfo);
253 subject, search, replace, lastMatchInfo);
265 return StringReplaceGlobalRegExpWithFunction(subject, search, replace);
268 return StringReplaceNonGlobalRegExpWithFunction(subject, search, replace);
275 IS_STRING(replace) &&
276 %StringIndexOf(replace, '$', 0) < 0) {
280 return %StringReplaceOneCharWithString(subject, search, replace);
289 if (IS_SPEC_FUNCTION(replace)) {
290 var receiver = %GetDefaultReceiver(replace);
291 result += %_CallFunction(receiver, search, start, subject, replace);
295 result = ExpandReplacement(TO_STRING_INLINE(replace),
408 function StringReplaceGlobalRegExpWithFunction(subject, regexp, replace) { argument
439 var receiver = %GetDefaultReceiver(replace);
456 %_CallFunction(receiver, elem, match_start, subject, replace);
464 var receiver = %GetDefaultReceiver(replace);
471 var func_result = %Apply(replace, receiver, elem, 0, elem.length);
485 function StringReplaceNonGlobalRegExpWithFunction(subject, regexp, replace) { argument
499 var receiver = %GetDefaultReceiver(replace);
504 replacement = %_CallFunction(receiver, s, index, subject, replace);
513 replacement = %Apply(replace, receiver, parameters, 0, j + 2);
833 return TO_STRING_INLINE(str).replace(/"/g, """);