Closed mittorn closed 6 years ago
What environment are you running in? Is this a particular browser?
var mfs = new BrowserFS.FileSystem.MountableFileSystem();
BrowserFS.initialize(mfs);
Using ZipFS and LocalStorage separately works, but i need both in same time
UC Browser 11
ArrayBuffer.isView
is a standard function, but it looks like we should use a polyfill in browsers without it (IE 10 and, apparently, UC Browser 11). I'll fix this in the next minor version update.
Browser does not have any debug tools , but in firefox this code seems to work. IsView was added in ES6?
As far as I know, isView has been around in most ArrayBuffer
implementations since typed arrays were added to browsers. But it was added later on during the specification process.
It seems easy enough to address.
Yes, it is ES6, but i want to support ES5 because all other things work fine now and some browsers still not support latest version.
If you need an instant workaround, I believe the following code should fix things:
if (!ArrayBuffer['isView']) {
ArrayBuffer.isView = function(a) {
return a !== null && typeof(a) === "object" && a['buffer'] instanceof ArrayBuffer;
};
}
(Note: My fix to BrowserFS won't modify the global scope like this.)
Thank you, it work now.
This is an issue in the buffer
dependency that was fixed recently:
https://github.com/feross/buffer/commit/2ac965b088d5e9019930c3d9016c7a213994e2fb
No BrowserFS-specific code calls ArrayBuffer.isView()
.
The next release will use the new buffer
version, and will not call isView
if it does not exist.
Code:
Result:
Exception thrown: Uncaught TypeError: Object function ArrayBuffer() { [native code] } has no method 'isView'
Browser: UC Browser 11