es.error.to-string.js 371 B

12345678910
  1. var defineBuiltIn = require('../internals/define-built-in');
  2. var errorToString = require('../internals/error-to-string');
  3. var ErrorPrototype = Error.prototype;
  4. // `Error.prototype.toString` method fix
  5. // https://tc39.es/ecma262/#sec-error.prototype.tostring
  6. if (ErrorPrototype.toString !== errorToString) {
  7. defineBuiltIn(ErrorPrototype, 'toString', errorToString);
  8. }