main
Last change
on this file since 79a0317 was 79a0317, checked in by stefan toskovski <stefantoska84@…>, 3 days ago |
F4 Finalna Verzija
|
-
Property mode
set to
100644
|
File size:
804 bytes
|
Line | |
---|
1 | 'use strict';
|
---|
2 | var globalThis = require('../internals/global-this');
|
---|
3 | var shared = require('../internals/shared');
|
---|
4 | var hasOwn = require('../internals/has-own-property');
|
---|
5 | var uid = require('../internals/uid');
|
---|
6 | var NATIVE_SYMBOL = require('../internals/symbol-constructor-detection');
|
---|
7 | var USE_SYMBOL_AS_UID = require('../internals/use-symbol-as-uid');
|
---|
8 |
|
---|
9 | var Symbol = globalThis.Symbol;
|
---|
10 | var WellKnownSymbolsStore = shared('wks');
|
---|
11 | var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol['for'] || Symbol : Symbol && Symbol.withoutSetter || uid;
|
---|
12 |
|
---|
13 | module.exports = function (name) {
|
---|
14 | if (!hasOwn(WellKnownSymbolsStore, name)) {
|
---|
15 | WellKnownSymbolsStore[name] = NATIVE_SYMBOL && hasOwn(Symbol, name)
|
---|
16 | ? Symbol[name]
|
---|
17 | : createWellKnownSymbol('Symbol.' + name);
|
---|
18 | } return WellKnownSymbolsStore[name];
|
---|
19 | };
|
---|
Note:
See
TracBrowser
for help on using the repository browser.