js-confuser
Advanced tools
Comparing version 1.5.3 to 1.5.4
@@ -0,1 +1,8 @@ | ||
# `1.5.4` | ||
Small fix | ||
- Fixed [#45](https://github.com/MichaelXF/js-confuser/issues/45) | ||
- - Opaque predicates fixed to not this cause error | ||
# `1.5.3` | ||
@@ -2,0 +9,0 @@ Shuffle fix |
@@ -135,3 +135,3 @@ "use strict"; | ||
if (object.type == "SwitchCase") { | ||
if (object.type == "SwitchCase" && object.test) { | ||
var matching = (0, _gen.Identifier)((0, _random.choice)(["undefined", "null"])); | ||
@@ -138,0 +138,0 @@ var test = object.test; |
{ | ||
"name": "js-confuser", | ||
"version": "1.5.3", | ||
"version": "1.5.4", | ||
"description": "JavaScript Obfuscation Tool.", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -202,4 +202,4 @@ import Transform from "./transform"; | ||
var cloned = clone(expr); | ||
if (object.type == "SwitchCase") { | ||
var matching = Identifier(choice(["undefined", "null"])); | ||
if (object.type == "SwitchCase" && object.test) { | ||
var matching: Node = Identifier(choice(["undefined", "null"])); | ||
@@ -206,0 +206,0 @@ var test = object.test; |
@@ -19,1 +19,26 @@ import JsConfuser from "../../src/index"; | ||
}); | ||
// https://github.com/MichaelXF/js-confuser/issues/45 | ||
it("should work on default Switch cases", async ()=>{ | ||
var code = ` | ||
switch (0) { | ||
default: | ||
input(true); | ||
} | ||
`; | ||
var output = await JsConfuser(code, { | ||
target: "browser", | ||
opaquePredicates: true, | ||
}); | ||
var value; | ||
function input(valueIn){ | ||
value = valueIn; | ||
} | ||
eval(output); | ||
expect(value).toStrictEqual(true); | ||
}) |
@@ -107,3 +107,2 @@ import JsConfuser from "../../src/index"; | ||
expect(output).toContain("TEST_ARRAY=function"); | ||
expect(output).not.toContain("1,2,3,4,5,6,7,8,9"); | ||
@@ -110,0 +109,0 @@ var value; |
1267239
34750