Skip to content

Commit

Permalink
drop internals/object-create dependency from `internals/error-to-st…
Browse files Browse the repository at this point in the history
…ring`
  • Loading branch information
zloirock committed Oct 6, 2023
1 parent 2d1d9ca commit a8fa1d6
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions packages/core-js/internals/error-to-string.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,15 @@
var DESCRIPTORS = require('../internals/descriptors');
var fails = require('../internals/fails');
var anObject = require('../internals/an-object');
var create = require('../internals/object-create');
var normalizeStringArgument = require('../internals/normalize-string-argument');

var nativeErrorToString = Error.prototype.toString;

var INCORRECT_TO_STRING = fails(function () {
if (DESCRIPTORS) {
// Chrome 32- incorrectly call accessor
// eslint-disable-next-line es/no-object-defineproperty -- safe
var object = create(Object.defineProperty({}, 'name', { get: function () {
// eslint-disable-next-line es/no-object-create, es/no-object-defineproperty -- safe
var object = Object.create(Object.defineProperty({}, 'name', { get: function () {
return this === object;
} }));
if (nativeErrorToString.call(object) !== 'true') return true;
Expand Down

0 comments on commit a8fa1d6

Please sign in to comment.