ebidel / idb.filesystem.js

HTML5 Filesystem API polyfill using IndexedDB
https://www.npmjs.com/package/idb.filesystem.js
Other
487 stars 46 forks source link

Calling getDirectory with undefined should return same dir #12

Open Sebmaster opened 11 years ago

Sebmaster commented 11 years ago

Not sure if that's intended as-is, but when calling getDirectory with undefined in chrome, chrome calls the callback with the same DirectoryEntry on which getDirectory was called on.

Calling getDirectory with undefined is probably always a bug, in order to be in line with chrome the shim should follow it's behaviour though, not sure which way is better.

ebidel commented 11 years ago

Agreed. It should do what the specs says. If the spec doesn't have answers, turn to Chrome's implementation :)

Sebmaster commented 11 years ago

I couldn't find any exact specification in the W3C definition.

It says Otherwise, if no other error occurs, getDirectory must return a DirectoryEntrySync corresponding to path. though, not sure if undefined as argument is an error.