This assumption originally held true, but the implementation was removed
for release builds in #139. This change broke code that relied upon
callbacks being asynchronous, including glob-stream, when using
synchronous filesystem backends. Reintroduce the callback wrapping
behaviour so that the assumption holds true once again.
The BrowserFS
FileSystem
interface documents several assumptions about arguments passed to API implementations. Notably, it is documented that callbacks will reset the stack depth usingsetImmediate
. https://github.com/jvilk/BrowserFS/blob/28a26cbcb89b5cef59a586f55045aabe98561f47/src/core/file_system.ts#L57-L59This assumption originally held true, but the implementation was removed for release builds in #139. This change broke code that relied upon callbacks being asynchronous, including glob-stream, when using synchronous filesystem backends. Reintroduce the callback wrapping behaviour so that the assumption holds true once again.