libs/es6-shim.js
function Set() {
            var set = this;
            set = emulateES6construct(set);
            if (!set._es6set) {
              throw new TypeError('bad set');
            }

            defineProperties(set, {
              '[[SetData]]': null,
              '_storage': emptyObject()
            });

            // Optionally initialize map from iterable
            var iterable = arguments[0];
            if (iterable !== undefined && iterable !== null) {
              var it = ES.GetIterator(iterable);
              var adder = set.add;
              if (!ES.IsCallable(adder)) { throw new TypeError('bad set'); }
              while (true) {
                var next = ES.IteratorNext(it);
                if (next.done) { break; }
                var nextItem = next.value;
                adder.call(set, nextItem);
              }
            }
            return set;
          }
function Set() {
            var set = this;
            set = emulateES6construct(set);
            if (!set._es6set) {
              throw new TypeError('bad set');
            }

            defineProperties(set, {
              '[[SetData]]': null,
              '_storage': emptyObject()
            });

            // Optionally initialize map from iterable
            var iterable = arguments[0];
            if (iterable !== undefined && iterable !== null) {
              var it = ES.GetIterator(iterable);
              var adder = set.add;
              if (!ES.IsCallable(adder)) { throw new TypeError('bad set'); }
              while (true) {
                var next = ES.IteratorNext(it);
                if (next.done) { break; }
                var nextItem = next.value;
                adder.call(set, nextItem);
              }
            }
            return set;
          }
function Set ( ) { var set = this ; set = emulateES6construct ( set ) ; if ( ! set . _es6set ) { throw new TypeError ( 'bad set' ) ; } defineProperties ( set , { '[[SetData]]' : null , '_storage' : emptyObject ( ) } ) ; // Optionally initialize map from iterable var iterable = arguments [ 0 ] ; if ( iterable !== undefined && iterable !== null ) { var it = ES . GetIterator ( iterable ) ; var adder = set . add ; if ( ! ES . IsCallable ( adder ) ) { throw new TypeError ( 'bad set' ) ; } while ( true ) { var next = ES . IteratorNext ( it ) ; if ( next . done ) { break ; } var nextItem = next . value ; adder . call ( set , nextItem ) ; } } return set ; }
Creating a Map is expensive.  To speed up the common case of Sets containing only string or numeric keys, we use an object as backing storage and lazily create a full Map only when required.
Creating a Map is expensive . To speed up the common case of Sets containing only string or numeric keys we use an object as backing storage and lazily create a full Map only when required .