Skip to content

Commit e0b8a9f

Browse files
committed
[Fix] do not use Object.prototype.toString when Symbol.toStringTag is shammed
1 parent 9590e61 commit e0b8a9f

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ var tryBooleanObject = function booleanBrandCheck(value) {
1313
}
1414
};
1515
var boolClass = '[object Boolean]';
16-
var hasToStringTag = typeof Symbol === 'function' && typeof Symbol.toStringTag === 'symbol';
16+
var hasToStringTag = typeof Symbol === 'function' && !!Symbol.toStringTag;
1717

1818
module.exports = function isBoolean(value) {
1919
if (typeof value === 'boolean') {

test/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
var test = require('tape');
44
var isBoolean = require('../');
5-
var hasSymbols = typeof Symbol === 'function' && typeof Symbol('') === 'symbol';
5+
var hasSymbols = require('has-symbols/shams')();
66

77
test('not Booleans', function (t) {
88
t.test('primitives', function (st) {

0 commit comments

Comments
 (0)