string.prototype.split
Version:
An ES spec-compliant `String.prototype.split` shim/polyfill/replacement that works as far down as ES3
18 lines (13 loc) • 422 B
JavaScript
;
var split = require('../');
var test = require('tape');
var runTests = require('./tests');
test('as a function', function (t) {
t.test('bad first arg/receiver', function (st) {
st['throws'](function () { split(undefined); }, TypeError, 'undefined is not an object');
st['throws'](function () { split(null); }, TypeError, 'null is not an object');
st.end();
});
runTests(split, t);
t.end();
});