pageFromCfi(cfi) {
    var pg = -1; // Check if the pageList has not been set yet

    if (this.locations.length === 0) {
      return -1;
    } // TODO: check if CFI is valid?
    // check if the cfi is in the location list
    // var index = this.locations.indexOf(cfi);


    var index = Object(core["indexOfSorted"])(cfi, this.locations, this.epubcfi.compare);

    if (index != -1) {
      pg = this.pages[index];
    } else {
      // Otherwise add it to the list of locations
      // Insert it in the correct position in the locations page
      //index = EPUBJS.core.insert(cfi, this.locations, this.epubcfi.compare);
      index = Object(core["locationOf"])(cfi, this.locations, this.epubcfi.compare); // Get the page at the location just before the new one, or return the first

      pg = index - 1 >= 0 ? this.pages[index - 1] : this.pages[0];

      if (pg !== undefined) {// Add the new page in so that the locations and page array match up
        //this.pages.splice(index, 0, pg);
      } else {
        pg = -1;
      }
    }

    return pg;
  }
Get a PageList result from a EpubCFI
@param  {string} cfi EpubCFI String
@return {number} page