Skip to content

BigInt literals are broken. #588

Closed
Closed

Description

@alula

Expected Behavior

BigInt literals are supported properly as normal numbers.

Current Behavior

ESNext bigint literals are converted to normal numbers, resulting in broken code.

function a(b){return b<<10&4660;}a(123);

Stack trace

TypeError: Cannot mix BigInt and other types, use explicit conversions

Your Environment

  • Obfuscator version used: 0.27.2
  • Node version used: v12.10.0

Minimal working example that will help to reproduce issue

function test(a) {
  return a << 10n & 0x1234n
}
test(123n);

Activity

  1. sanex3339 commented on Apr 25, 2020

    @sanex3339
    Member

    escodegen currently doesn't support it

  2. sanex3339 commented on Apr 25, 2020

    @sanex3339
    Member

    Hmm. Looks like I can fix it on my side.

  3. sanex3339 commented on Apr 25, 2020

    @sanex3339
    Member
  4. sanex3339 commented on Apr 25, 2020

    @sanex3339
    Member

    Support in master. Expect a release later today.

  5. sanex3339 commented on Apr 25, 2020

    @sanex3339
    Member

    Released as 0.28.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions