fakeBlob.js 363 B

1234567891011121314151617
  1. /*
  2. * A fake blob used in tests since not every browser supports Blob yet.
  3. *
  4. * @param {Array} blob
  5. */
  6. function FakeBlob (blob) {
  7. this._blob = blob
  8. this.size = blob.length
  9. }
  10. FakeBlob.prototype.slice = function (start, end) {
  11. return new FakeBlob(this._blob.slice(start, end))
  12. }
  13. FakeBlob.prototype.stringify = function () {
  14. return this._blob.join('')
  15. }