-
Notifications
You must be signed in to change notification settings - Fork 27.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
…#8848) ### Description <!-- ✍️ Write a short summary of your work. If necessary, include relevant screenshots. --> ### Testing Instructions <!-- Give a quick description of steps to test your changes. --> --------- Co-authored-by: 강동윤 (Donny) <[email protected]>
- Loading branch information
Showing
2 changed files
with
29 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
crates/turbopack-tests/tests/execution/turbopack/renaming/eval/input/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
module; // <- This is important! | ||
|
||
it("should not rename variables when eval is used", () => { | ||
const modules = { | ||
x: (module) => { | ||
"use strict"; | ||
return eval("module"); | ||
}, | ||
}; | ||
const moduleArrowFunction = (module) => { | ||
"use strict"; | ||
return eval("module"); | ||
}; | ||
function moduleFunciton(module) { | ||
"use strict"; | ||
return eval("module"); | ||
} | ||
expect(modules.x(42)).toBe(42); | ||
expect(moduleArrowFunction(42)).toBe(42); | ||
expect(moduleFunciton(42)).toBe(42); | ||
}); |