5b1ec7bdf08a6716969440b4571ed19b5808a45acd8dab753ef45bc9f2b86efaf92694b0b2554b49f9892292f36e78c5986763d5c915de399ac92cb3d8c885 608 B

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