Open anywhichway opened 5 days ago
Great find, this is Control Flow Flattening's expression transformation causing this issue.
Simply disabling controlFlowFlattening
will prevent the error.
Alternatively you could try 2.0.0-alpha.3 as it's fixed (Demo)
1.7.3 Source Code Causing Error: https://github.com/MichaelXF/js-confuser/blob/79efb6fa94192025810937b9f5c7461ba568aaf6/src/transforms/controlFlowFlattening/expressionObfuscation.ts#L60
Thanks for quick response. Will go with turning of flattening for now. Going to production with our app tonight or tomorrow. Will look at alpha as time allows.
From: Michael Brasington @.> Sent: Tuesday, November 19, 2024 12:03:26 PM To: MichaelXF/js-confuser @.> Cc: Simon Y. Blackwell @.>; Author @.> Subject: Re: [MichaelXF/js-confuser] Delete operation fails (Issue #155)
Great find, this is Control Flow Flattening's expression transformation causing this issue.
Simply disabling controlFlowFlattening will prevent the error.
Alternatively you could try 2.0.0-alpha.3https://www.npmjs.com/package/js-confuser/v/2.0.0-alpha.3 as it's fixed (Demohttps://new--confuser.netlify.app/editor?code=var+a+%3D+%7B%0A++key1%3A+true%2C%0A++key2%3A+true%2C%0A++key3%3A+true%2C%0A++last%3A+true%2C%0A%7D%3B%0A%0Adelete+a%5B%27key1%27%5D%3B%0Adelete+a%5B%27key2%27%5D%3B%0Adelete+a%5B%27key3%27%5D%3B%0A%0Alet+b%3B%0A%0Aconsole.log%28a%29%3B%0A&config=%2F%2F+This+file+is+evaluated+as+JavaScript.+You+can+use+JavaScript+here.%0A%2F%2F+Learn+more%3A+https%3A%2F%2Fjs-confuser.com%2Fdocs%2Fgetting-started%2Fplayground%23jsconfuser-ts%0A%0Amodule.exports+%3D+%7B%0A++target%3A+%27browser%27%2C%0A++preset%3A+%27high%27%2C%0A%7D%3B%0A)
1.7.3 Source Code Causing Error: https://github.com/MichaelXF/js-confuser/blob/79efb6fa94192025810937b9f5c7461ba568aaf6/src/transforms/controlFlowFlattening/expressionObfuscation.ts#L60
— Reply to this email directly, view it on GitHubhttps://github.com/MichaelXF/js-confuser/issues/155#issuecomment-2486638744, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ABF2US24BLSS3OCMB64MZ6T2BOKQ5AVCNFSM6AAAAABSCGVZSOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIOBWGYZTQNZUGQ. You are receiving this because you authored the thread.Message ID: @.***>
Describe the bug:
Deleting a property does not succeed in removing a property
Config and Small code sample
Config:
Code:
this code
is transformed to
Expected behavior
the property name bound to 'id' should be deleted from invitations
Actual behavior
the property is not deleted
Additional context
I believe the transformation
__p_4869811828(delete (delete partners[name], invitations[id]), delete users[id], ... other code)
is incorrect and should be__p_4869811828(delete partners[name], delete invitations[id], delete users[id], ... other code)
This code works when transformed: