Browse Source

Return an empty object when failing to determine global scope.

pull/370/head
Sergi Almacellas Abellana 8 years ago
parent
commit
ff398191f2
  1. 7
      papaparse.js

7
papaparse.js

@ -35,10 +35,11 @@ @@ -35,10 +35,11 @@
if (typeof window !== 'undefined') { return window; }
if (typeof global !== 'undefined') { return global; }
throw new Error('Cannot determine global object');
// When running tests none of the above have been defined
return {};
})();
var IS_WORKER = !global.document && !!global.postMessage,
IS_PAPA_WORKER = IS_WORKER && /(\?|&)papaworker(=|&|$)/.test(global.location.search),
LOADED_SYNC = false, AUTO_SCRIPT_PATH;

Loading…
Cancel
Save