UNPKG

string.prototype.split

Version:

An ES spec-compliant `String.prototype.split` shim/polyfill/replacement that works as far down as ES3

24 lines (18 loc) 609 B
'use strict'; var define = require('define-properties'); var callBind = require('call-bind'); var RequireObjectCoercible = require('es-object-atoms/RequireObjectCoercible'); var implementation = require('./implementation'); var getPolyfill = require('./polyfill'); var shim = require('./shim'); var bound = callBind(getPolyfill()); var boundMethod = function split(receiver, separator, limit) { RequireObjectCoercible(receiver); return bound(receiver, separator, limit); }; define(boundMethod, { getPolyfill: getPolyfill, implementation: implementation, shim: shim }); module.exports = boundMethod;