Skip to content

Commit

Permalink
Merge pull request #7478 from webpack/fix/5889
Browse files Browse the repository at this point in the history
Ensure `require` is truthy
  • Loading branch information
sokra committed Jun 5, 2018
2 parents 5653732 + 348057f commit b5b1e86
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test/cases/parsing/issue-5889/index.js
@@ -0,0 +1,5 @@
const result = require("./module");

it("should correctly replace 'require' bindings", () => {
expect(result).toBe(true);
});
6 changes: 6 additions & 0 deletions test/cases/parsing/issue-5889/module.js
@@ -0,0 +1,6 @@
let result = false;
if (require) {
result = true;
}

module.exports = result;

0 comments on commit b5b1e86

Please sign in to comment.