Re: Why no TypeError in FileReaderSync.readAsArrayBuffer

Norman,
On Nov 7, 2013, at 5:00 PM, Norman Rzepka | scalable minds wrote:

> because I didn't know a FileEntrySync was actually not a File, I passed an instance of FileEntrySync to a FileReaderSync. Instead I got a NotFoundError which I found very confusing as I know the file was present. So I was wondering why there is no TypeError for such situations?
> 


The API you're testing -- namely code which uses FileEntrySync primitives -- is likely to work in Chrome only, and isn't a standard with other browser vendors, which do implement the File API.

Currently, the FileSystem API (which, going forward is this draft; http://w3c.github.io/filesystem-api/Overview.html) doesn't have a FileEntrySync primitive.  And the File API is http://dev.w3.org/2006/webapi/FileAPI/#FileReaderSync .

In this particular case, I think it's the right behavior: FileReaderSync expects a valid File or Blob reference, and isn't able to identify one, so says one isn't found.

-- A*



> Best, 
> Norman
> 
> --
> Norman Rzepka
> 
> norman.rzepka@scalableminds.com
> http://scalableminds.com
> 
> scalable minds
> UG (haftungsbeschränkt) & Co. KG
> Amtsgericht Potsdam, HRA 5753
> Geschäftsführer: Dominic Bräunlein, Tom Bocklisch, Tom Herold, Norman Rzepka, Thomas Werkmeister

Received on Monday, 11 November 2013 13:57:58 UTC