a-constructor.js 401 B

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