Skip to content

FR: Avoid using bigint literal syntax to target older browsers #541

Closed
@mman

Description

@mman

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:

if (input > 2n ** 32n || input < -(2n ** 32n)) {
received = addNumericalSeparator(received)

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions