Prevent if (!state || false) { in the output, in PDFHistory._popState, for e.g. MOZCENTRAL builds

By re-ordering the condition, which includes a `PDFJSDev` check, we can avoid meaningless output in the built files.
This commit is contained in:
Jonas Jenwald 2019-12-03 20:53:00 +01:00
parent c5f2f870cb
commit 1fab637247

View File

@ -527,9 +527,9 @@ class PDFHistory {
let newHash = getCurrentHash(), hashChanged = this._currentHash !== newHash;
this._currentHash = newHash;
if (!state ||
(typeof PDFJSDev !== 'undefined' && PDFJSDev.test('CHROME') &&
state.chromecomState && !this._isValidState(state))) {
if ((typeof PDFJSDev !== 'undefined' && PDFJSDev.test('CHROME') &&
state && state.chromecomState && !this._isValidState(state)) ||
!state) {
// This case corresponds to the user changing the hash of the document.
this._uid++;