1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 | "use strict";
|
7 |
|
8 | const Dependency = require("../Dependency");
|
9 | const makeSerializable = require("../util/makeSerializable");
|
10 | const ModuleDependency = require("./ModuleDependency");
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 | class WebAssemblyExportImportedDependency extends ModuleDependency {
|
18 | constructor(exportName, request, name, valueType) {
|
19 | super(request);
|
20 |
|
21 | this.exportName = exportName;
|
22 |
|
23 | this.name = name;
|
24 |
|
25 | this.valueType = valueType;
|
26 | }
|
27 |
|
28 | |
29 |
|
30 |
|
31 | couldAffectReferencingModule() {
|
32 | return Dependency.TRANSITIVE;
|
33 | }
|
34 |
|
35 | |
36 |
|
37 |
|
38 |
|
39 |
|
40 |
|
41 | getReferencedExports(moduleGraph, runtime) {
|
42 | return [[this.name]];
|
43 | }
|
44 |
|
45 | get type() {
|
46 | return "wasm export import";
|
47 | }
|
48 |
|
49 | get category() {
|
50 | return "wasm";
|
51 | }
|
52 |
|
53 | serialize(context) {
|
54 | const { write } = context;
|
55 |
|
56 | write(this.exportName);
|
57 | write(this.name);
|
58 | write(this.valueType);
|
59 |
|
60 | super.serialize(context);
|
61 | }
|
62 |
|
63 | deserialize(context) {
|
64 | const { read } = context;
|
65 |
|
66 | this.exportName = read();
|
67 | this.name = read();
|
68 | this.valueType = read();
|
69 |
|
70 | super.deserialize(context);
|
71 | }
|
72 | }
|
73 |
|
74 | makeSerializable(
|
75 | WebAssemblyExportImportedDependency,
|
76 | "webpack/lib/dependencies/WebAssemblyExportImportedDependency"
|
77 | );
|
78 |
|
79 | module.exports = WebAssemblyExportImportedDependency;
|