feige
2024-02-20 b9f97457e9d8e8a0f784c25b103697fca8fea2e4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
'use strict';
 
var trim = require('../implementation');
var test = require('tape');
var hasStrictMode = require('has-strict-mode')();
var callBind = require('call-bind');
 
var runTests = require('./tests');
 
test('as a function', function (t) {
    t.test('bad array/this value', { skip: !hasStrictMode }, function (st) {
        /* eslint no-useless-call: 0 */
        st['throws'](function () { trim.call(undefined, 'a'); }, TypeError, 'undefined is not an object');
        st['throws'](function () { trim.call(null, 'a'); }, TypeError, 'null is not an object');
        st.end();
    });
 
    runTests(callBind(trim), t);
 
    t.end();
});