Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

shuffle != hash is re-using variable x and crashing #53

Closed
Le0Developer opened this issue Jan 17, 2023 · 0 comments
Closed

shuffle != hash is re-using variable x and crashing #53

Le0Developer opened this issue Jan 17, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@Le0Developer
Copy link

Describe the bug:

One of the shuffle variants (for shuffle != hash) is re-using the variables x, z and i.
If they are present before (very likely), it'll compile to invalid JS code.

Config and Small code sample

Code:

let x = -999;
let a = [1, 2, 3, 4, 5, 6];

Expected behavior

Should run.

Actual behavior

Uncaught SyntaxError: Identifier 'x' has already been declared when running.

let x = -999;
let a = [
    2,
    3,
    4,
    5,
    6,
    1
];
var __p_6792745382 = a;
for (var x = 16; x % 4 === 0; x++) {
    var z = 0;
    a = __p_6792745382 = __p_6792745382.concat(function () {
        z++;
        if (z === 1) {
            return [];
        }
        for (var i = 20; i; i--) {
            __p_6792745382.unshift(__p_6792745382.pop());
        }
        return [];
    }());
}
for (var __p_4040364912 = 13; __p_4040364912; __p_4040364912--) {
    __p_6792745382.unshift(__p_6792745382.pop());
}
@Le0Developer Le0Developer added the bug Something isn't working label Jan 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant