function define(name, fun) {
    let obj = exportPath(name);
    let exports = fun();
    for (let propertyName in exports) {
      // Maybe we should check the prototype chain here? The current usage
      // pattern is always using an object literal so we only care about own
      // properties.
      let propertyDescriptor = Object.getOwnPropertyDescriptor(
        exports,
        propertyName
      );
      if (propertyDescriptor)
        Object.defineProperty(obj, propertyName, propertyDescriptor);
    }
  }
Calls |fun| and adds all the fields of the returned object to the object
named by |name|. For example, cr.define('cr.ui', function() {
  function List() {
    ...
  }
  function ListItem() {
    ...
  }
  return {
    List: List,
    ListItem: ListItem,
  };
});
defines the functions cr.ui.List and cr.ui.ListItem.
@param {string} name The name of the object that we are adding fields to.
@param {!Function} fun The function that will return an object containing
    the names and values of the new fields.