-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use native-buffer-browserify
#36
Conversation
I approve of this. Just make sure to bump the package major version and we can update the packages that need to be updated downstream. |
Okay, done! |
I'm looking at this now :) |
So this means we no longer support IE8, right. I'm fine with that but its obviously not a decision I can make! I have opened issue #37 and it will need to be resolved first. Anyway, good job, I haven't executed the complete test suite but it looks good and I think this could solve a lot of issues :) |
If people care about IE8-9, they can use a polyfill for Not sure if this should be included by
Yeah, the whole |
Actually, we shouldn't include any polyfills. |
Just tested it on chrome (will get around IE later today) and there are 23 failing test (out of 2187). They seams quite important and passes with the current implementation so those bugs should be fixed. I have selected the failing files for you so you can just run:
to see for yourself. |
Okay, finished installing my Windows VM :) In IE11 and I got the same 23 errors. I couldn't test on IE10 since IETester don't support it when I have IE11. I hope this will be fixed soon but lets just assume the result is the same. |
Thanks for pointing out the failing tests -- I should have caught that. I made some changes and I can confirm that everything passes now. I ran all the |
I confirmed that all @substack I'm not very familiar with |
I haven't read the browserify source code but in many cases you can just add the constructor to the sandbox parameter. (But there are also quite a few where you can't). a = vm.createScript('console.log(Uint8Array([1,1,1]).length)');
a.runInNewContext({ 'Uint8Array': global.Uint8Array, 'console': console }); // prints 3 But since this will be released in a new major version I wouldn't worry that much about the browserify tests. At last, the pull requests dosen't merge could you rebase? |
Much faster buffer, backed with ArrayBuffer.
- Fix test failures caused by incorrect default param coercion on `Buffer.toString`. - Fix documentation to show support for all modern browsers, plus IE10+. - Add Firefox support using ES6 Proxy (see rationale below). Firefox ES6 Proxy Workaround ======================== Firefox does not allow augmenting "native" objects (like Uint8Array instances) with new properties for some unknown (probably silly) reason. So we use an ES6 Proxy (supported since Firefox 18) to wrap the Uint8Array instance without actually adding any properties to it.
Rebased - try merging now! |
@AndreasMadsen Neat, adding the constructor to the sandbox parameter worked. Once this PR is merged, I'll send another PR on browserify that bumps the node-browser-builtins version and fixes the tests that were failing. |
Use `native-buffer-browserify`
Much faster buffer, backed with ArrayBuffer.