B2G/gecko/toolkit/identity/tests/unit/head_identity.js
// uses as a pointer back into the doc object
uses as a pointer back into the doc object
uses as a pointer back into the doc object
function mock_doc(aIdentity, aOrigin, aDoFunc) {
  let mockedDoc = {};
  mockedDoc.id = uuid();
  mockedDoc.loggedInUser = aIdentity;
  mockedDoc.origin = aOrigin;
  mockedDoc['do'] = aDoFunc;
  mockedDoc.doReady = partial(aDoFunc, 'ready');
  mockedDoc.doLogin = partial(aDoFunc, 'login');
  mockedDoc.doLogout = partial(aDoFunc, 'logout');
  mockedDoc.doError = partial(aDoFunc, 'error');
  mockedDoc.doCancel = partial(aDoFunc, 'cancel');
  mockedDoc.doCoffee = partial(aDoFunc, 'coffee');
  return mockedDoc;
}
function mock_doc ( aIdentity , aOrigin , aDoFunc ) { let mockedDoc = { } ; mockedDoc . id = uuid ( ) ; mockedDoc . loggedInUser = aIdentity ; mockedDoc . origin = aOrigin ; mockedDoc [ 'do' ] = aDoFunc ; mockedDoc . doReady = partial ( aDoFunc , 'ready' ) ; mockedDoc . doLogin = partial ( aDoFunc , 'login' ) ; mockedDoc . doLogout = partial ( aDoFunc , 'logout' ) ; mockedDoc . doError = partial ( aDoFunc , 'error' ) ; mockedDoc . doCancel = partial ( aDoFunc , 'cancel' ) ; mockedDoc . doCoffee = partial ( aDoFunc , 'coffee' ) ; return mockedDoc ; }
uses as a pointer back into the doc object
uses as a pointer back into the doc object