Expected Behavior
Obfuscation completes for valid JavaScript that contains a string literal with surrogate code units used in a regex range.
Current Behavior
Base64 string-array encoding throws URIError: URI malformed. This reproduces in v5.4.1 and appears related to the previously fixed #530.
Steps to Reproduce
- Install
javascript-obfuscator@5.4.1.
- Run the minimal example below.
JavaScript Obfuscator Edition
- JavaScript Obfuscator Open Source
Your Environment
- Obfuscator version used: 5.4.1
- Node version used: v23.7.0
Stack trace
URIError: URI malformed
at encodeURIComponent (<anonymous>)
Minimal working example that will help to reproduce issue
const JavaScriptObfuscator = require("javascript-obfuscator");
JavaScriptObfuscator.obfuscate(
String.raw`const controlSymbolRegexString = "\\\\[^\uD800-\uDFFF]";`,
{
stringArray: true,
stringArrayEncoding: ["base64"],
stringArrayThreshold: 1,
splitStrings: true,
splitStringsChunkLength: 5,
seed: 1,
},
);
Expected Behavior
Obfuscation completes for valid JavaScript that contains a string literal with surrogate code units used in a regex range.
Current Behavior
Base64 string-array encoding throws
URIError: URI malformed. This reproduces in v5.4.1 and appears related to the previously fixed #530.Steps to Reproduce
javascript-obfuscator@5.4.1.JavaScript Obfuscator Edition
Your Environment
Stack trace
Minimal working example that will help to reproduce issue