a-constructor.js 351 B

12345678910
  1. var isConstructor = require('../internals/is-constructor');
  2. var tryToString = require('../internals/try-to-string');
  3. var $TypeError = TypeError;
  4. // `Assert: IsConstructor(argument) is true`
  5. module.exports = function (argument) {
  6. if (isConstructor(argument)) return argument;
  7. throw $TypeError(tryToString(argument) + ' is not a constructor');
  8. };