question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] Destroy Private Fields

See original GitHub issue

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()

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:10 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
sanex3339commented, Feb 9, 2022

Such statements might be added to any places outside of a class

0reactions
BlackYuziacommented, Feb 10, 2022

Yep, fixed image

#1053 trouble isn’t fixed yet :c

Read more comments on GitHub >

github_iconTop Results From Across the Web

How can I stop warnings about unused private fields?
Per this answer, try. QMAKE_CXXFLAGS_WARN_ON += -Wno-unused-private-field. It appears that the QMAKE_CXXFLAGS_WARN_ON flags are added to the compiler ...
Read more >
C++ static code analysis: Unused "private" fields should be ...
If a private field is declared but not used in the program, it can be considered dead code and should therefore be removed....
Read more >
10 most deadly bugs that destroy crop production
Bollworm Thrips Pod sucking bugs Rootborer Weevil Mealybugs Berry Borer Fruit & shoot borer Aphids
Read more >
How to Repair and Restore Grass Destroyed by Insects
Spread new seed in the areas affected by the insect damage. You will want to remove the damaged turf areas and loosen the...
Read more >
Insects and their Injury to Plants - CT.gov
However, insects seldom destroy these plants. The threat of damage by insects need not prevent an attempt to grow any of these plants....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found