js-confuser icon indicating copy to clipboard operation
js-confuser copied to clipboard

Control Flow Flattening breaks strict-mode redefined function declaration

Open MichaelXF opened this issue 2 years ago • 0 comments

Config and Small code sample

Config:

{
  target: "node",
  controlFlowFlattening: true
}

Code:

"use strict";
var myFunction = function () {
  console.log("Inner");
};

if (true) {
  function myFunction() {
    console.log("Outer");
  }
}

myFunction();

Expected behavior

The program should output "Inner"

Actual behavior

The program outputs "Outer"

MichaelXF avatar Jun 06 '23 05:06 MichaelXF