string.prototype.split
Advanced tools
Comparing version 1.0.2 to 1.0.3
@@ -8,2 +8,8 @@ # Changelog | ||
## [v1.0.3](https://github.com/es-shims/String.prototype.split/compare/v1.0.2...v1.0.3) - 2020-11-21 | ||
### Commits | ||
- [Fix] `node` `v0.8`: ensure the raw implementation includes this bugfix [`60d4bf2`](https://github.com/es-shims/String.prototype.split/commit/60d4bf221617c4ef7e94b80b39620a8534f020cf) | ||
## [v1.0.2](https://github.com/es-shims/String.prototype.split/compare/v1.0.1...v1.0.2) - 2020-11-19 | ||
@@ -10,0 +16,0 @@ |
'use strict'; | ||
// var ToObject = require('es-abstract/2020/ToObject'); | ||
var callBind = require('call-bind'); | ||
var callBound = require('call-bind/callBound'); | ||
var $split = callBind.apply(String.prototype.split); | ||
var $split = callBound('String.prototype.split'); | ||
module.exports = function split() { | ||
// var O = ToObject(this); | ||
return $split(this, arguments); | ||
/* | ||
* [bugfix, chrome, node 0.8] | ||
* If separator is undefined, then the result array contains just one String, | ||
* which is the this value (converted to a String). If limit is not undefined, | ||
* then the output array is truncated so that it contains no more than limit | ||
* elements. | ||
* "0".split(undefined, 0) -> [] | ||
*/ | ||
module.exports = function split(separator, limit) { | ||
if (typeof separator === 'undefined' && limit === 0) { | ||
return []; | ||
} | ||
return $split(this, separator, limit); | ||
}; |
{ | ||
"name": "string.prototype.split", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "An ES spec-compliant `String.prototype.split` shim/polyfill/replacement that works as far down as ES3", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -23,3 +23,3 @@ 'use strict'; | ||
/* | ||
* [bugfix, chrome] | ||
* [bugfix, chrome, node 0.8] | ||
* If separator is undefined, then the result array contains just one String, | ||
@@ -32,4 +32,3 @@ * which is the this value (converted to a String). If limit is not undefined, | ||
if ('0'.split(void 0, 0).length) { | ||
// eslint-disable-next-line global-require | ||
return require('./implementation-undefined-separator'); | ||
return implementation; | ||
} | ||
@@ -36,0 +35,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
25568
22
365