debian-mirror-gitlab/core-js/internals/object-to-string.js
2019-09-25 13:30:05 +05:30

14 lines
474 B
JavaScript

'use strict';
var classof = require('../internals/classof');
var wellKnownSymbol = require('../internals/well-known-symbol');
var TO_STRING_TAG = wellKnownSymbol('toStringTag');
var test = {};
test[TO_STRING_TAG] = 'z';
// `Object.prototype.toString` method implementation
// https://tc39.github.io/ecma262/#sec-object.prototype.tostring
module.exports = String(test) !== '[object z]' ? function toString() {
return '[object ' + classof(this) + ']';
} : test.toString;