readable-stream
readable-stream copied to clipboard
FR: Avoid using bigint literal syntax to target older browsers
One of my projects targets very old specialised browsers, and when readable-stream
dependency is brought in the webpack produced code fails to run because of SyntaxError
here:
https://github.com/nodejs/readable-stream/blob/a2e9aedf4aeee4a5e4d8efcb175edb67e2817eaa/src/errors.js#L339-L340
Turns out that specialised browser based on WebKit can not parse bigint literals.
I'm not sure if I am missing something but I was not able to find a solution to transpile the bigint literals correctly to target older browsers.
But turns out that the fix could be to avoid bigint literal and use BigInt
constructor.