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
/Users/chenbingfeng/freeprojects/openwebmonitor-real/node_modules/javascript-obfuscator/dist/webpack:/JavaScriptObfuscator/src/code-transformers/preparing-transformers/HashbangOperatorTransformer.ts:39
.replace(/^#!.$(\r?\n)/m, (substring) => {
^
TypeError: e.replace is not a function
Activity
sanex3339 commentedon Apr 4, 2020
Need more info. Show your source code
sanex3339 commentedon Apr 10, 2020
ping
aceimnorstuvwxz commentedon Apr 12, 2020
`
// obfuscate js code
const JavaScriptObfuscator = require('javascript-obfuscator');
const fs = require('fs')
const path = require('path')
const what_to_obfuscate = [
'super-source', 'super-module', 'main', 'recording', 'index', 'constants', 'browser', 'utils', 'vip_renew', 'winmgr',
'libopenlog'
]
what_to_obfuscate.forEach(fn=>{
let full_path = path.join(__dirname,
${fn}.js)console.log(full_path)
let raw_data = fs.readFileSync(full_path)
})
`
aceimnorstuvwxz commentedon Apr 12, 2020
Read a js file, and obs them, then write back.
aceimnorstuvwxz commentedon Apr 12, 2020
Above error happens when using the lastest version. when changed to old version "javascript-obfuscator": "~0.19.4" it disappears.
sanex3339 commentedon Apr 12, 2020
Are you sure that
raw_datafor each file isstringand notundefined?aceimnorstuvwxz commentedon Apr 12, 2020
yes, if file not exist, exception will happen when read. Im sure, that all
raw_dataare a string,aceimnorstuvwxz commentedon Apr 12, 2020
For be sure, I will check it doubel later
sanex3339 commentedon Apr 12, 2020
Check it please. Because this error can happen if source code is not a string.
From my side i should add exception from the obfuscator side if input source code is not a string
sanex3339 commentedon Apr 12, 2020
So, i got this error, when i passed
numberas source code.Fixed #590
sanex3339 commentedon Apr 13, 2020
Released as
0.27.4Now if source code is not a string, it will be normalized to an empty string.