es.error.to-string.js 354 B

12345678910
  1. var redefine = require('../internals/redefine');
  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. redefine(ErrorPrototype, 'toString', errorToString);
  8. }