Add bindings for String.prototype.replace

This commit is contained in:
Danielle Pham
2018-08-19 14:42:22 -04:00
parent 7b53b1c88e
commit 44877880bb
3 changed files with 37 additions and 1 deletions

View File

@ -1 +1,7 @@
exports.new_string_object = () => new String("hi");
exports.new_string_object = () => new String("hi");
exports.get_replacer_function = function() {
return function upperToHyphenLower(match, offset, string) {
return (offset > 0 ? '-' : '') + match.toLowerCase();
};
};