diff options
| author | Florian Dold <florian.dold@gmail.com> | 2017-08-14 05:01:11 +0200 |
|---|---|---|
| committer | Florian Dold <florian.dold@gmail.com> | 2017-08-14 05:02:09 +0200 |
| commit | 363723fc84f7b8477592e0105aeb331ec9a017af (patch) | |
| tree | 29f92724f34131bac64d6a318dd7e30612e631c7 /node_modules/es5-ext/reg-exp/#/match | |
| parent | 5634e77ad96bfe1818f6b6ee70b7379652e5487f (diff) | |
node_modules
Diffstat (limited to 'node_modules/es5-ext/reg-exp/#/match')
4 files changed, 29 insertions, 0 deletions
diff --git a/node_modules/es5-ext/reg-exp/#/match/implement.js b/node_modules/es5-ext/reg-exp/#/match/implement.js new file mode 100644 index 000000000..ba89bcec1 --- /dev/null +++ b/node_modules/es5-ext/reg-exp/#/match/implement.js @@ -0,0 +1,8 @@ +"use strict"; + +if (!require("./is-implemented")()) { + Object.defineProperty(RegExp.prototype, "match", { value: require("./shim"), + configurable: true, +enumerable: false, +writable: true }); +} diff --git a/node_modules/es5-ext/reg-exp/#/match/index.js b/node_modules/es5-ext/reg-exp/#/match/index.js new file mode 100644 index 000000000..b74d2f295 --- /dev/null +++ b/node_modules/es5-ext/reg-exp/#/match/index.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = require("./is-implemented")() + ? RegExp.prototype.match + : require("./shim"); diff --git a/node_modules/es5-ext/reg-exp/#/match/is-implemented.js b/node_modules/es5-ext/reg-exp/#/match/is-implemented.js new file mode 100644 index 000000000..a5065fc72 --- /dev/null +++ b/node_modules/es5-ext/reg-exp/#/match/is-implemented.js @@ -0,0 +1,8 @@ +"use strict"; + +var re = /foo/; + +module.exports = function () { + if (typeof re.match !== "function") return false; + return re.match("barfoobar") && !re.match("elo"); +}; diff --git a/node_modules/es5-ext/reg-exp/#/match/shim.js b/node_modules/es5-ext/reg-exp/#/match/shim.js new file mode 100644 index 000000000..295582186 --- /dev/null +++ b/node_modules/es5-ext/reg-exp/#/match/shim.js @@ -0,0 +1,8 @@ +"use strict"; + +var validRegExp = require("../../valid-reg-exp"); + +module.exports = function (string) { + validRegExp(this); + return String(string).match(this); +}; |
