initialize method

void initialize()

Initialize Symbol constructor properties and methods

Implementation

void initialize() {
  // Static methods
  setProperty(
    'for',
    JSNativeFunction(functionName: 'for', nativeImpl: symbolForMethod),
  );

  setProperty(
    'keyFor',
    JSNativeFunction(functionName: 'keyFor', nativeImpl: keyForMethod),
  );

  // Well-known symbols
  setProperty('iterator', JSSymbol.iterator);
  setProperty('asyncIterator', JSSymbol.asyncIterator);
  setProperty('toStringTag', JSSymbol.toStringTag);
  setProperty('hasInstance', JSSymbol.hasInstance);
  setProperty('species', JSSymbol.species);
  setProperty('toPrimitive', JSSymbol.symbolToPrimitive);
  setProperty('match', JSSymbol.match);
  setProperty('replace', JSSymbol.replace);
  setProperty('search', JSSymbol.search);
  setProperty('split', JSSymbol.split);
  setProperty('isConcatSpreadable', JSSymbol.isConcatSpreadable);
  setProperty('unscopables', JSSymbol.unscopables);
}