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

Backtick does not work in code #1245

Open
royallife88 opened this issue Apr 9, 2024 · 0 comments
Open

Backtick does not work in code #1245

royallife88 opened this issue Apr 9, 2024 · 0 comments

Comments

@royallife88
Copy link

Hi,

 var obfuscationResult = JavaScriptObfuscator.obfuscate(
        `// File 3
const fruits = ['Apple', 'Banana', 'Orange'];

fruits.forEach((fruit, index) => {
    console.log(`Fruit ${index + 1}: ${fruit}`);
});
`,
        {
            identifiersPrefix: 'TEST3JS',
            compact: true,
            controlFlowFlattening: true,
            controlFlowFlatteningThreshold: 1,
            deadCodeInjection: true,
            deadCodeInjectionThreshold: 1,
            debugProtection: true,
            debugProtectionInterval: 4000,
            disableConsoleOutput: true,
            identifierNamesGenerator: 'hexadecimal',
            log: false,
            numbersToExpressions: true,
            renameGlobals: false,
            selfDefending: true,
            simplify: true,
            splitStrings: true,
            splitStringsChunkLength: 5,
            stringArray: true,
            stringArrayCallsTransform: true,
            stringArrayEncoding: ['rc4'],
            stringArrayIndexShift: true,
            stringArrayRotate: true,
            stringArrayShuffle: true,
            stringArrayWrappersCount: 5,
            stringArrayWrappersChainedCalls: true,
            stringArrayWrappersParametersMaxCount: 5,
            stringArrayWrappersType: 'function',
            stringArrayThreshold: 1,
            transformObjectKeys: true,
            unicodeEscapeSequence: false
        }
    );

Give this error
files-page:1538 Uncaught SyntaxError: missing ) after argument list

The problem is with Back-tick ` used in code and string interpolation have the problem, how to handle with this situation.

Also tried
String.raw` // File 3
const fruits = ['Apple', 'Banana', 'Orange'];

fruits.forEach((fruit, index) => {
console.log(Fruit ${index + 1}: ${fruit});
});
`

also give error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant