X Tutup
Skip to content

Generates obfuscated codes with a syntax error when if or else clause contains only one const / let assignment statement #661

@HealthyPeace

Description

@HealthyPeace

Example inputs that cause the problem

if (true) {
    const n = 42;
}

is obfuscated into

if(!![])const n=0x2a;
if (true) {
} else {
  let n = 42;
}

is obfuscated into

if(!![]){}else let n=0x2a;

When if or else clause contains only one statement, { and } are omitted in the obfuscated code and this makes a problematic sequence of words like if const <statement> or else let <statement>.

Steps to Reproduce

  1. Access https://obfuscator.io/ and leave all the options default.
  2. Obfuscate examples above.
  3. Input the obfuscated code into Chrome console and see the result.

Your Environment

Chrome 83.0.4103.116 (Official Build) (64 bit) (cohort: Stable)

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

      X Tutup