B2G/gecko/toolkit/mozapps/extensions/XPIProvider.jsm
/**
   * Rolls back all the moves that this operation performed. If an exception
   * occurs here then both old and new directories are left in an indeterminate
   * state
   */
Rolls back all the moves that this operation performed. If an exception
occurs here then both old and new directories are left in an indeterminate
state
Rolls back all the moves that this operation performed . If an exception occurs here then both old and new directories are left in an indeterminate state
function SIO_rollback() {
    while (this._installedFiles.length > 0) {
      let move = this._installedFiles.pop();
      if (move.newFile.isDirectory()) {
        let oldDir = move.oldFile.parent.clone();
        oldDir.append(move.oldFile.leafName);
        oldDir.create(Ci.nsIFile.DIRECTORY_TYPE, FileUtils.PERMS_DIRECTORY);
      }
      else if (!move.oldFile) {
        move.newFile.remove(true);
      }
      else {
        move.newFile.moveTo(move.oldFile.parent, null);
      }
    }
    while (this._createdDirs.length > 0)
      recursiveRemove(this._createdDirs.pop());
  }
function SIO_rollback ( ) { while ( this . _installedFiles . length > 0 ) { let move = this . _installedFiles . pop ( ) ; if ( move . newFile . isDirectory ( ) ) { let oldDir = move . oldFile . parent . clone ( ) ; oldDir . append ( move . oldFile . leafName ) ; oldDir . create ( Ci . nsIFile . DIRECTORY_TYPE , FileUtils . PERMS_DIRECTORY ) ; } else if ( ! move . oldFile ) { move . newFile . remove ( true ) ; } else { move . newFile . moveTo ( move . oldFile . parent , null ) ; } } while ( this . _createdDirs . length > 0 ) recursiveRemove ( this . _createdDirs . pop ( ) ) ; }
Rolls back all the moves that this operation performed.
Rolls back all the moves that this operation performed .
// No old file means this was a copied file