File tree 1 file changed +31
-0
lines changed
1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -1204,6 +1204,35 @@ const deStringConcealing = {
1204
1204
} ,
1205
1205
}
1206
1206
1207
+ /**
1208
+ * Template:
1209
+ * ```javascript
1210
+ * // This is defined in the glocal space
1211
+ * var predicateName = (function () {
1212
+ * var tempName = {
1213
+ * prop_array_1: [],
1214
+ * prop_array: function (paramName = 'length') {
1215
+ * if (!predicateName[prop_array_1][0]) {
1216
+ * predicateName[prop_array_1][0].push(rand1)
1217
+ * }
1218
+ * return predicateName[prop_array_1][paramName]
1219
+ * },
1220
+ * prop_number: rand2,
1221
+ * prop_string: rand_str,
1222
+ * }
1223
+ * return tempName
1224
+ * })()
1225
+ * // Below will appear multiple times
1226
+ * predicateName[prop_array]() ? test : fake
1227
+ * predicateName[prop_number] > rand3 ? test : fake
1228
+ * predicateName[prop_string].charAt(index) == real_char ? test : fake
1229
+ * predicateName[prop_string].charCodeAt(index) == real_char ? test : fake
1230
+ * ```
1231
+ */
1232
+ const deOpaquePredicates = {
1233
+ MemberExpression ( path ) { } ,
1234
+ }
1235
+
1207
1236
module . exports = function ( code ) {
1208
1237
let ast
1209
1238
try {
@@ -1227,6 +1256,8 @@ module.exports = function (code) {
1227
1256
traverse ( ast , deStringConcealing )
1228
1257
// StringSplitting
1229
1258
traverse ( ast , calculateConstantExp )
1259
+ // OpaquePredicates
1260
+ traverse ( ast , deOpaquePredicates )
1230
1261
code = generator ( ast , {
1231
1262
comments : false ,
1232
1263
jsescOption : { minimal : true } ,
You can’t perform that action at this time.
0 commit comments