Open 307914070 opened 3 years ago
That's expected because buffer@6
dropped support of IE11: https://github.com/feross/buffer/commit/840160f352ff0d8e88d4ac308a1640fd278f50fc
This issue also affects certain older Android 6 devices, like the Oukitel K6000. The exponentiation operator was introduced in ES2016, which makes it newer than things like the import
keyword or arrow functions. However, it's not just the exponentiation operator - buffer
also includes default parameters to functions and other ES6 syntax.
We are going to work around this issue on our end by running buffer
through Babel during our build step, but it would be preferable to to skip this.
That's expected because
buffer@6
dropped support of IE11: 840160f
should the readme mention this as it currently says 'all browsers'?
As of 4th of August 2021, after 8 months of release of the v6, weekly downloads stats has spoken:
You can check any other npm package, no one - that has such a success like this one - has so slow migration in such a long time.
I think it's clear that community chose version compatible with IE 11 (and old mobile devices). It would be nice to take these feedback in account, but I also understand you don't force anybody to upgrade - luckily. Of course we can use some tricks while building, but in my case I prefer to not complexify and maintain extra build steps.
@feross
With PR #308 the doublestar is avoided by preferring precalculated values. So atleast the IE11 fraction should have not the issue by having a totally breaking buffer implementation.
if use v6 in IE 11, use babel to extra transpile
in the pulgins "buffer", The code below is not work in IE 11.
Buffer.prototype.readBigUInt64LE = defineBigIntMethod(function readBigUInt64LE (offset) { offset = offset >>> 0 validateNumber(offset, 'offset') const first = this[offset] const last = this[offset + 7] if (first === undefined || last === undefined) { boundsError(offset, this.length - 8) }
const lo = first + this[++offset] * 2 8 + this[++offset] * 2 * 16 + this[++offset] 2 24
const hi = this[++offset] + this[++offset] * 2 8 + this[++offset] * 2 * 16 + last 2 24
return BigInt(lo) + (BigInt(hi) << BigInt(32)) })