diff --git a/crates/turbopack-tests/tests/execution/turbopack/side-effects-optimization/comptime/input/index.js b/crates/turbopack-tests/tests/execution/turbopack/side-effects-optimization/comptime/input/index.js index 39d9b3af9652e4..e082085cc32b67 100644 --- a/crates/turbopack-tests/tests/execution/turbopack/side-effects-optimization/comptime/input/index.js +++ b/crates/turbopack-tests/tests/execution/turbopack/side-effects-optimization/comptime/input/index.js @@ -4,6 +4,7 @@ import { something2 } from "package/dep2.js"; it("should not include a module that is side effect free and exports are not used due to static analysis", () => { if (true) { something2(); + return; } something(); }); diff --git a/crates/turbopack-tests/tests/snapshot/comptime/early-return/output/crates_turbopack-tests_tests_snapshot_comptime_early-return_input_99b3d5._.js.map b/crates/turbopack-tests/tests/snapshot/comptime/early-return/output/crates_turbopack-tests_tests_snapshot_comptime_early-return_input_99b3d5._.js.map index 999ef3f2493ebc..b028ae01f7ea74 100644 --- a/crates/turbopack-tests/tests/snapshot/comptime/early-return/output/crates_turbopack-tests_tests_snapshot_comptime_early-return_input_99b3d5._.js.map +++ b/crates/turbopack-tests/tests/snapshot/comptime/early-return/output/crates_turbopack-tests_tests_snapshot_comptime_early-return_input_99b3d5._.js.map @@ -2,7 +2,7 @@ "version": 3, "sources": [], "sections": [ - {"offset": {"line": 5, "column": 0}, "map": {"version":3,"sources":["turbopack://[project]/crates/turbopack-tests/tests/snapshot/comptime/early-return/input/module.js"],"sourcesContent":["export function a() {\n if (true) {\n a1();\n return;\n }\n a2();\n var a3 = 3;\n function a4() {\n var a5;\n }\n (function a6() {\n var a7;\n });\n const a8 = () => {\n var a9;\n };\n class a10 {}\n let a11 = 11;\n}\n\nexport function b() {\n if (true) {\n b1();\n return;\n } else {\n b2();\n }\n b3();\n}\n\nexport function c() {\n if (true) {\n return;\n }\n c1();\n}\n\nexport function d() {\n if (true) {\n return;\n } else {\n d1();\n }\n d2();\n}\n\nexport function e() {\n if (false) {\n e1();\n } else {\n return;\n }\n e2();\n}\nexport function f() {\n if (false) {\n } else {\n return;\n }\n f1();\n}\n\nexport function g() {\n if (false) {\n g1();\n } else {\n g2();\n return;\n }\n g3();\n}\nexport function h() {\n if (false) {\n } else {\n h1();\n return;\n }\n h2();\n}\n\nexport function i(j) {\n if (j < 1) return i1();\n return i2();\n}\n\nexport function j(j) {\n if (j < 1) {\n return i1();\n }\n return i2();\n}\n"],"names":[],"mappings":";;;;;;;;;;;;AAAO,SAAS;IACd,wCAAU;QACR;QACA;IACF;;IAEA,IAAI;IACJ,SAAS;QACP,IAAI;IACN;IAIA,MAAM;IAGA,IAAA;IACN,IAAI;AACN;AAEO,SAAS;IACd,wCAAU;QACR;QACA;IACF,OAAO;;IAEP;;AAEF;AAEO,SAAS;IACd,wCAAU;QACR;IACF;;AAEF;AAEO,SAAS;IACd,wCAAU;QACR;IACF,OAAO;;IAEP;;AAEF;AAEO,SAAS;IACd,uCAAW;;IAEX,OAAO;QACL;IACF;;AAEF;AACO,SAAS;IACd,uCAAW,CACX,OAAO;QACL;IACF;;AAEF;AAEO,SAAS;IACd,uCAAW;;IAEX,OAAO;QACL;QACA;IACF;;AAEF;AACO,SAAS;IACd,uCAAW,CACX,OAAO;QACL;QACA;IACF;;AAEF;AAEO,SAAS,EAAE,CAAC;IACjB,IAAI,IAAI,GAAG,OAAO;IAClB,OAAO;AACT;AAEO,SAAS,EAAE,CAAC;IACjB,IAAI,IAAI,GAAG;QACT,OAAO;IACT;IACA,OAAO;AACT"}}, + {"offset": {"line": 5, "column": 0}, "map": {"version":3,"sources":["turbopack://[project]/crates/turbopack-tests/tests/snapshot/comptime/early-return/input/module.js"],"sourcesContent":["export function a() {\n if (true) {\n a1();\n return;\n }\n a2();\n var a3 = 3;\n function a4() {\n var a5;\n }\n (function a6() {\n var a7;\n });\n const a8 = () => {\n var a9;\n };\n class a10 {}\n let a11 = 11;\n}\n\nexport function b() {\n if (true) {\n b1();\n return;\n } else {\n b2();\n }\n b3();\n}\n\nexport function c() {\n if (true) {\n return;\n }\n c1();\n}\n\nexport function d() {\n if (true) {\n return;\n } else {\n d1();\n }\n d2();\n}\n\nexport function e() {\n if (false) {\n e1();\n } else {\n return;\n }\n e2();\n}\n\nexport function f() {\n if (false) {\n } else {\n return;\n }\n f1();\n}\n\nexport function g() {\n if (false) {\n g1();\n } else {\n g2();\n return;\n }\n g3();\n}\n\nexport function h() {\n if (false) {\n } else {\n h1();\n return;\n }\n h2();\n}\n\nexport function i(j) {\n if (j < 1) return i1();\n return i2();\n}\n\nexport function j(j) {\n if (j < 1) {\n return i1();\n }\n return i2();\n}\n"],"names":[],"mappings":";;;;;;;;;;;;AAAO,SAAS;IACd,wCAAU;QACR;QACA;IACF;;IAEA,IAAI;IACJ,SAAS;QACP,IAAI;IACN;IAIA,MAAM;IAGA,IAAA;IACN,IAAI;AACN;AAEO,SAAS;IACd,wCAAU;QACR;QACA;IACF,OAAO;;IAEP;;AAEF;AAEO,SAAS;IACd,wCAAU;QACR;IACF;;AAEF;AAEO,SAAS;IACd,wCAAU;QACR;IACF,OAAO;;IAEP;;AAEF;AAEO,SAAS;IACd,uCAAW;;IAEX,OAAO;QACL;IACF;;AAEF;AAEO,SAAS;IACd,uCAAW,CACX,OAAO;QACL;IACF;;AAEF;AAEO,SAAS;IACd,uCAAW;;IAEX,OAAO;QACL;QACA;IACF;;AAEF;AAEO,SAAS;IACd,uCAAW,CACX,OAAO;QACL;QACA;IACF;;AAEF;AAEO,SAAS,EAAE,CAAC;IACjB,IAAI,IAAI,GAAG,OAAO;IAClB,OAAO;AACT;AAEO,SAAS,EAAE,CAAC;IACjB,IAAI,IAAI,GAAG;QACT,OAAO;IACT;IACA,OAAO;AACT"}}, {"offset": {"line": 94, "column": 0}, "map": {"version":3,"sources":[],"names":[],"mappings":"A"}}, {"offset": {"line": 99, "column": 0}, "map": {"version":3,"sources":["turbopack://[project]/crates/turbopack-tests/tests/snapshot/comptime/early-return/input/index.js"],"sourcesContent":["import * as module from \"./module\";\nconsole.log(module);\n"],"names":[],"mappings":";;;;AACA,QAAQ,GAAG,CAAC"}}, {"offset": {"line": 104, "column": 0}, "map": {"version":3,"sources":[],"names":[],"mappings":"A"}}]