gecko/dom/workers/test/fileReadSlice_worker.js
Matthew Schranz f4ee122174 Bug 725289 - Removed moz prefix in Blob.mozSlice. r=sicking
--HG--
rename : dom/workers/test/fileReadMozSlice_worker.js => dom/workers/test/fileReadSlice_worker.js
rename : dom/workers/test/fileMozSlice_worker.js => dom/workers/test/fileSlice_worker.js
rename : dom/workers/test/test_fileReadMozSlice.xul => dom/workers/test/test_fileReadSlice.xul
rename : dom/workers/test/test_fileMozSlice.xul => dom/workers/test/test_fileSlice.xul
2012-02-16 11:22:25 +01:00

17 lines
421 B
JavaScript

/**
* Expects an object containing a blob, a start index and an end index
* for slicing. Returns the contents of the blob read as text.
*/
onmessage = function(event) {
var blob = event.data.blob;
var start = event.data.start;
var end = event.data.end;
var slicedBlob = blob.slice(start, end);
var fileReader = new FileReaderSync();
var text = fileReader.readAsText(slicedBlob);
postMessage(text);
};