Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
19 additions
and
16 deletions.
There are no files selected for viewing
4 changes: 2 additions & 2 deletions
4
packages/core-js-pure/override/internals/set-to-string-tag.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,9 @@ | ||
'use strict'; | ||
var TO_STRING_TAG_SUPPORT = require('../internals/to-string-tag-support'); | ||
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() { | ||
module.exports = TO_STRING_TAG_SUPPORT ? {}.toString : function toString() { | ||
return '[object ' + classof(this) + ']'; | ||
} : test.toString; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
var wellKnownSymbol = require('../internals/well-known-symbol'); | ||
|
||
var TO_STRING_TAG = wellKnownSymbol('toStringTag'); | ||
var test = {}; | ||
|
||
test[TO_STRING_TAG] = 'z'; | ||
|
||
module.exports = String(test) === '[object z]'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,9 @@ | ||
var TO_STRING_TAG_SUPPORT = require('../internals/to-string-tag-support'); | ||
var redefine = require('../internals/redefine'); | ||
var toString = require('../internals/object-to-string'); | ||
|
||
var ObjectPrototype = Object.prototype; | ||
|
||
// `Object.prototype.toString` method | ||
// https://tc39.github.io/ecma262/#sec-object.prototype.tostring | ||
if (toString !== ObjectPrototype.toString) { | ||
redefine(ObjectPrototype, 'toString', toString, { unsafe: true }); | ||
if (!TO_STRING_TAG_SUPPORT) { | ||
redefine(Object.prototype, 'toString', toString, { unsafe: true }); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters