castl
castl copied to clipboard
String.prototype.replace() without RegExp
The first argument of String.prototype.replace() is actually interpreted as a Lua search pattern, not as a string.
For example, this code
console.log("String.prototype.replace()".replace("$", " is buggy"))
prints String.prototype.replace() is buggy
, while it should just print String.prototype.replace()
.