File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -121,7 +121,7 @@ function decodeGlobal(ast) {
121
121
if ( node_table . node . id ) {
122
122
var_string_table = node_table . node . id . name
123
123
} else {
124
- while ( ! t . isVariableDeclarator ( node_table ) ) {
124
+ while ( ! node_table . isVariableDeclarator ( ) ) {
125
125
node_table = node_table . parentPath
126
126
}
127
127
var_string_table = node_table . node . id . name
@@ -159,7 +159,11 @@ function decodeGlobal(ast) {
159
159
let decrypt_val
160
160
let binds = refs . string_path . scope . getBinding ( var_string_table )
161
161
// remove path of string table
162
- decrypt_code [ 1 ] = refs . string_path . node
162
+ if ( refs . string_path . isVariableDeclarator ( ) ) {
163
+ decrypt_code [ 1 ] = t . variableDeclaration ( 'var' , [ refs . string_path . node ] )
164
+ } else {
165
+ decrypt_code [ 1 ] = refs . string_path . node
166
+ }
163
167
refs . string_path . remove ( )
164
168
// iterate refs
165
169
for ( let bind of binds . referencePaths ) {
You can’t perform that action at this time.
0 commit comments