src/workspaces.js
function _createProxy(ids, workspaces) {
  const _workspaces = makeArray(ids).map(id=>{
    if (!workspaces.has(id)) workspaces.set(id, {});
    return workspaces.get(id);
  });

  return new Proxy(global, {
    get: function(target, property, receiver) {
      if (property === 'global') return global;
      for (let n=0; n<_workspaces.length; n++) {
        if (property in _workspaces[n]) return Reflect.get(_workspaces[n], property, receiver);
      }
      return Reflect.get(target, property, receiver);
    },
    has: function(target, property) {
      for (let n=0; n<_workspaces.length; n++) {
        if (property in _workspaces[n]) return true;
      }
      return Reflect.has(target, property);
    },
    set: function(target, property, value, receiver) {
      return Reflect.set(target, property, value, receiver);
    }
  });
}
function _createProxy(ids, workspaces) {
  const _workspaces = makeArray(ids).map(id=>{
    if (!workspaces.has(id)) workspaces.set(id, {});
    return workspaces.get(id);
  });

  return new Proxy(global, {
    get: function(target, property, receiver) {
      if (property === 'global') return global;
      for (let n=0; n<_workspaces.length; n++) {
        if (property in _workspaces[n]) return Reflect.get(_workspaces[n], property, receiver);
      }
      return Reflect.get(target, property, receiver);
    },
    has: function(target, property) {
      for (let n=0; n<_workspaces.length; n++) {
        if (property in _workspaces[n]) return true;
      }
      return Reflect.has(target, property);
    },
    set: function(target, property, value, receiver) {
      return Reflect.set(target, property, value, receiver);
    }
  });
}
function _createProxy ( ids , workspaces ) { const _workspaces = makeArray ( ids ) . map ( id => { if ( ! workspaces . has ( id ) ) workspaces . set ( id , { } ) ; return workspaces . get ( id ) ; } ) ; return new Proxy ( global , { get : function ( target , property , receiver ) { if ( property === 'global' ) return global ; for ( let n = 0 ; n < _workspaces . length ; n ++ ) { if ( property in _workspaces [ n ] ) return Reflect . get ( _workspaces [ n ] , property , receiver ) ; } return Reflect . get ( target , property , receiver ) ; } , has : function ( target , property ) { for ( let n = 0 ; n < _workspaces . length ; n ++ ) { if ( property in _workspaces [ n ] ) return true ; } return Reflect . has ( target , property ) ; } , set : function ( target , property , value , receiver ) { return Reflect . set ( target , property , value , receiver ) ; } } ) ; }
Create a Proxy for use a sandbox global.

@private
@param {Array.<Symbol>} ids        The workspaces to apply to the proxy, in order of use.
@param {Workspaces} workspaces     The workspaces store.
@returns {Proxy}                   The created proxy.
Create a Proxy for use a sandbox global .