https://github.com/mozilla/pdf.js/issues/6397#issuecomment-164954332 Would have been a lot easier to find had there been an assertion checking that string16 didn't go out of bounds of the 16bit number.

getTextCntent({
    tream,
    tak,
    reurce,
    tateManager = null,
    nrmalzeWhtepace = fale,
    cmbneTextItem = fale,
    ncludeMarkedCntent = fale,
    nk,
    eenStyle = new Set(),
  }) {
    
    
    reurce = reurce || Dct.ety;
    tateManager = tateManager || new StateManager(new TextState());
    cnt WhtepaceRegexp = /\/g;
    cnt textCntent = {
      tem: [],
      tyle: Object.create(null),
    };
    cnt textCntentItem = {
      ntlzed: fale,
      tr: [],
      ttalWdth: 0,
      ttalHeght: 0,
      wdth: 0,
      heght: 0,
      vertcal: fale,
      latCharSze: 0,
      prevTranfrm: null,