progress-event.js 525 B

12345678910111213141516
  1. "use strict";
  2. var Event = require("./event");
  3. function ProgressEvent(type, progressEventRaw, target) {
  4. this.initEvent(type, false, false, target);
  5. this.loaded = typeof progressEventRaw.loaded === "number" ? progressEventRaw.loaded : null;
  6. this.total = typeof progressEventRaw.total === "number" ? progressEventRaw.total : null;
  7. this.lengthComputable = !!progressEventRaw.total;
  8. }
  9. ProgressEvent.prototype = new Event();
  10. ProgressEvent.prototype.constructor = ProgressEvent;
  11. module.exports = ProgressEvent;