Skip to content

Commit

Permalink
Merge pull request #8266 from ljqx/wasm-finalize-exports-fix
Browse files Browse the repository at this point in the history
[WasmFinalizeExportsPlugin] check if `ref` is null before using it
  • Loading branch information
sokra committed Oct 24, 2018
2 parents 735b4aa + 035ceb6 commit 298fa4c
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/wasm/WasmFinalizeExportsPlugin.js
Expand Up @@ -30,6 +30,8 @@ class WasmFinalizeExportsPlugin {
reason.dependency
);

if (!ref) continue;

const importedNames = ref.importedNames;

if (Array.isArray(importedNames)) {
Expand Down
3 changes: 3 additions & 0 deletions test/cases/wasm/finalize-exports-issue-8261/index.js
@@ -0,0 +1,3 @@
it("should not throw when no dependency reference", function() {
return expect(() => import("side-effect-free")).not.toThrow();
});

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions test/cases/wasm/finalize-exports-issue-8261/test.filter.js
@@ -0,0 +1,5 @@
var supportsWebAssembly = require("../../../helpers/supportsWebAssembly");

module.exports = function(config) {
return supportsWebAssembly();
};

0 comments on commit 298fa4c

Please sign in to comment.