| [ Web Proxy ] |
| Viewing: https://github-redirect.dependabot.com/browserify/browserify/pull/1932 | [Back] [Original] |
|
|
||
| if (!ArrayBuffer.isView) ArrayBuffer.isView = function () { return false; }; | ||
| if (!Object.setPrototypeOf) Object.setPrototypeOf = require('setprototypeof'); | ||
|
|
There was a problem hiding this comment.
instead of polyfilling it, should it be imported in the implementation? otherwise tests will be assuming the user has polyfilled it, which is not guaranteed.
There was a problem hiding this comment.
I think we can import it in the files that are being bundled for these tests, yes. buffer itself probably wouldn't want to add it because all of the browsers that they support have setPrototypeOf.
e; On second look it's actually a little harder to put the polyfill in the bundle in these specific tests. The buffer tests have to rely on a bunch of polyfills on old Node versions unfortunately. I don't like that we're passing in things like Object to the vm sandbox, the alternative would be to do something like b.require('./test/files/buffer_polyfills.js') and stick the things buffer needs in there.
| Web Proxy Viewer | New URL | Original Page |
The
buffershim needssetPrototypeOfsince feross/buffer#238.buffer's official support targets had it. Node 0.8/0.10 incidentally had the other things it needs, but not this.