Skip to content

[BUG] Destroy Private Fields #1056

@BlackYuzia

Description

@BlackYuzia

Expected Behavior

You could use private fields after obfuscation without errors

Current Behavior

You can't use private fields after obfuscation, but you could did it without (obfuscate).

Steps to Reproduce

  1. Use private fields
  2. Lose the keys Get error.

Your Environment

  • Obfuscator version used: 3.4.4
  • Node version used: 16.17.1

Stack trace

Minimal working example that will help to reproduce issue

class Kruzya {
    #keys; // private, you can't steal my keys!
    #count;

    constructor(name, count = 0) {
        this.#keys = [];
        this.name = name;
        this.#count = count;
    }

    stealKeys() {
        for (const iterator of new Array(this.#count).fill(0)) {
            this.#keys.push(iterator);
        }
    }

    getInfo() {
        console.log("%s, steal [%s] of your keys!", this.name, this.#keys.length);
    }

}

const kruzya = new Kruzya("Kruzya", ~~(Math.random() * 500));
kruzya.stealKeys();
kruzya.getInfo()

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions