Skip to content

Commit

Permalink
Ensure that when Symbol and Symbol.for are available, they're rea…
Browse files Browse the repository at this point in the history
…l Symbols and not gross fake ones.
  • Loading branch information
ljharb committed Oct 20, 2015
1 parent 8bd2153 commit ba20781
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ var define = require('define-properties');
var isSymbol = require('is-symbol');

var globalKey = '__ global cache key __';
if (typeof Symbol === 'function' && typeof Symbol['for'] === 'function') {
if (typeof Symbol === 'function' && isSymbol(Symbol()) && typeof Symbol['for'] === 'function') {
globalKey = Symbol['for'](globalKey);
}
if (!global[globalKey]) {
Expand Down

0 comments on commit ba20781

Please sign in to comment.