diff --git a/packages/core-js/features/object/to-string.js b/packages/core-js/features/object/to-string.js new file mode 100644 index 000000000000..8ce2a175ab88 --- /dev/null +++ b/packages/core-js/features/object/to-string.js @@ -0,0 +1,6 @@ +require('../../modules/es.object.to-string'); +var classof = require('../../internals/classof'); + +module.exports = function (it) { + return '[object ' + classof(it) + ']'; +}; diff --git a/tests/commonjs.js b/tests/commonjs.js index c3427fab04a2..609fff181ebe 100644 --- a/tests/commonjs.js +++ b/tests/commonjs.js @@ -28,6 +28,7 @@ for (const _PATH of ['../packages/core-js-pure', '../packages/core-js']) { ok(load('features/object/prevent-extensions')({})); ok(load('features/object/seal')({})); ok(load('features/object/set-prototype-of')({}, []) instanceof Array); + ok(load('features/object/to-string')([]) === '[object Array]'); ok(load('features/object/entries')({ q: 2 })[0][0] === 'q'); ok(load('features/object/values')({ q: 2 })[0] === 2); ok(load('features/object/get-own-property-descriptors')({ q: 1 }).q.enumerable);