array-method-is-strict.js 345 B

12345678910
  1. 'use strict';
  2. var fails = require('../internals/fails');
  3. module.exports = function (METHOD_NAME, argument) {
  4. var method = [][METHOD_NAME];
  5. return !!method && fails(function () {
  6. // eslint-disable-next-line no-useless-call,no-throw-literal -- required for testing
  7. method.call(null, argument || function () { throw 1; }, 1);
  8. });
  9. };