First commit

This commit is contained in:
2021-03-07 05:58:59 +01:00
committed by Andreas Schaafsma
commit 5d4c4a054e
18475 changed files with 3309357 additions and 0 deletions

View File

@@ -0,0 +1,10 @@
"use strict";
if (!require("./is-implemented")()) {
Object.defineProperty(RegExp.prototype, "replace", {
value: require("./shim"),
configurable: true,
enumerable: false,
writable: true
});
}

View File

@@ -0,0 +1,3 @@
"use strict";
module.exports = require("./is-implemented")() ? RegExp.prototype.replace : require("./shim");

View File

@@ -0,0 +1,8 @@
"use strict";
var re = /foo/;
module.exports = function () {
if (typeof re.replace !== "function") return false;
return re.replace("foobar", "mar") === "marbar";
};

View File

@@ -0,0 +1,8 @@
"use strict";
var validRegExp = require("../../valid-reg-exp");
module.exports = function (string, replaceValue) {
validRegExp(this);
return String(string).replace(this, replaceValue);
};