Skip to content

Commit

Permalink
fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
zloirock committed Sep 1, 2021
1 parent 4f4d95e commit 1c96c50
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/core-js/modules/es.symbol.description.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@ if (DESCRIPTORS && typeof NativeSymbol == 'function' && (!('description' in Nati
symbolPrototype.constructor = SymbolWrapper;

var symbolToString = symbolPrototype.toString;
var nativeString = String(NativeSymbol('test')) == 'Symbol(test)';
var nativeSymbol = String(NativeSymbol('test')) == 'Symbol(test)';
var regexp = /^Symbol\((.*)\)[^)]+$/;
defineProperty(symbolPrototype, 'description', {
configurable: true,
get: function description() {
var symbol = isObject(this) ? this.valueOf() : this;
var string = symbolToString.call(symbol);
if (has(EmptyStringDescriptionStore, symbol)) return '';
var desc = nativeString ? string.slice(7, -1) : string.replace(regexp, '$1');
var desc = nativeSymbol ? string.slice(7, -1) : string.replace(regexp, '$1');
return desc === '' ? undefined : desc;
}
});
Expand Down

0 comments on commit 1c96c50

Please sign in to comment.