Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
'use strict';
require('es5-shim');
require('es6-shim');
var matchAllShim = require('../');
matchAllShim.shim();
var test = require('tape');
var defineProperties = require('define-properties');
var bind = require('function-bind');
var hasSymbols = require('has-symbols')();
var regexMatchAll = require('../regexp-matchall');
var isEnumerable = Object.prototype.propertyIsEnumerable;
var functionsHaveNames = require('functions-have-names')();
var functionNamesConfigurable = require('functions-have-names').functionsHaveConfigurableNames();
var runTests = require('./tests');
test('shimmed', function (t) {
t.equal(String.prototype.matchAll.length, 1, 'String#matchAll has a length of 1');
t.test('Function name', { skip: !functionsHaveNames }, function (st) {
st.equal(String.prototype.matchAll.name, 'matchAll', 'String#matchAll has name "matchAll"');
st.end();
});
t.test('enumerability', { skip: !defineProperties.supportsDescriptors }, function (et) {
et.equal(false, isEnumerable.call(String.prototype, 'matchAll'), 'String#matchAll is not enumerable');
et.end();
});
t.test('Symbol.matchAll', { skip: !hasSymbols }, function (st) {
'use strict';
var functionsHaveNames = require('functions-have-names')();
var boundFunctionsHaveNames = require('functions-have-names').boundFunctionsHaveNames();
var forEach = require('for-each');
var inspect = require('object-inspect');
module.exports = function (AggregateError, t) {
t.test('constructor', function (st) {
st.equal(typeof AggregateError, 'function', 'is a function');
st.equal(AggregateError.length, 2, 'AggregateError has a length of 2');
st.test('Function name', { skip: !functionsHaveNames || !boundFunctionsHaveNames }, function (s2t) {
s2t.equal(AggregateError.name, 'AggregateError', 'AggregateError has name "AggregateError"');
s2t.end();
});
st.end();
});
'use strict';
var bind = require('function-bind');
var define = require('define-properties');
var functionsHaveConfigurableNames = require('functions-have-names').functionsHaveConfigurableNames();
var implementation = require('./implementation');
var getPolyfill = require('./polyfill');
var shim = require('./shim');
var polyfill = getPolyfill();
var bound = bind.call(polyfill);
if (functionsHaveConfigurableNames) {
Object.defineProperty(bound, 'name', { value: polyfill.name });
}
bound.prototype = polyfill.prototype;
define(bound, {
getPolyfill: getPolyfill,
implementation: implementation,
shim: shim