You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Custom code helpers are prepended before 'use strict', disabling strict mode #1475
Obfuscating code that contains a 'use strict' directive should keep 'use strict' as the first statement of the script or function body so that strict mode remains active when selfDefending: true, disableConsoleOutput: true, or debugProtection: true (or the low-obfuscation, medium-obfuscation, or high-obfuscation presets) are enabled.
Evaluating the obfuscated code in the example below should return true.
Current Behavior
Enabling selfDefending: true, disableConsoleOutput: true, or debugProtection: true inserts custom helper declarations and calls before the 'use strict' directive:
Because 'use strict' is no longer in the initial directive prologue of f(), strict mode is silently deactivated and evaluating the obfuscated code returns false instead of true.
Steps to Reproduce
Obfuscate a function or script containing 'use strict'; with selfDefending: true (or disableConsoleOutput: true / debugProtection: true).
Evaluate the obfuscated output and check whether strict mode is active (e.g., this === undefined inside an unqualified function call).
JavaScript Obfuscator Edition
JavaScript Obfuscator Open Source
Your Environment
Obfuscator version used: 5.10.0
Node version used: v24.14.1
Stack trace
N/A (wrong runtime behavior, no exception thrown)
Minimal working example that will help to reproduce issue
constJavaScriptObfuscator=require('javascript-obfuscator');constcode=`function f() { 'use strict'; return this === undefined;}f();`;constobfuscated=JavaScriptObfuscator.obfuscate(code,{selfDefending: true,stringArray: false}).getObfuscatedCode();console.log(eval(obfuscated));// prints false (expected: true)
Activity
Fixes for 1471-1477
sanex3339 commentedon Nov 12, 2026
Released as 5.10.1