Closed Eswcvlad closed 4 months ago
Looks like JavaScript toString is used on replacement, when subject is string and replacement is array:
replacement
subject
replace("🙂Юникод🙃", 1, 6, [1, 2, 3])
🙂1,2,3🙃
With what is in the spec right now I would expect a TypeError here.
Oddly enough, with objects it works as expected:
replace("🙂Юникод🙃", 1, 6, {a: 1})
TypeError
Looks like JavaScript toString is used on
replacement
, whensubject
is string andreplacement
is array:replace("🙂Юникод🙃", 1, 6, [1, 2, 3])
->🙂1,2,3🙃
With what is in the spec right now I would expect a TypeError here.
Oddly enough, with objects it works as expected:
replace("🙂Юникод🙃", 1, 6, {a: 1})
->TypeError