Sha256: 6e493a662488098d2a896415a9029c3f213f50f3e17a0f49c67d1d55c5d346e9

Contents?: true

Size: 587 Bytes

Versions: 3

Compression:

Stored size: 587 Bytes

Contents

import { GUID_KEY } from './guid';
import intern from './intern';
const GENERATED_SYMBOLS = [];
export function isInternalSymbol(possibleSymbol) {
    return GENERATED_SYMBOLS.indexOf(possibleSymbol) !== -1;
}
export default function symbol(debugName) {
    // TODO: Investigate using platform symbols, but we do not
    // want to require non-enumerability for this API, which
    // would introduce a large cost.
    let id = GUID_KEY + Math.floor(Math.random() * +new Date());
    let symbol = intern(`__${debugName}${id}__`);
    GENERATED_SYMBOLS.push(symbol);
    return symbol;
}

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
discourse-ember-source-3.6.0.0 dist/es/@ember/-internals/utils/lib/symbol.js
discourse-ember-source-3.5.1.1 dist/es/ember-utils/lib/symbol.js
discourse-ember-source-3.5.1.0 dist/dist/es/ember-utils/lib/symbol.js