source: trip-planner-front/node_modules/webpack/lib/dependencies/WebAssemblyExportImportedDependency.js@ 59329aa

Last change on this file since 59329aa was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 1.6 KB
Line 
1/*
2 MIT License http://www.opensource.org/licenses/mit-license.php
3 Author Tobias Koppers @sokra
4*/
5
6"use strict";
7
8const makeSerializable = require("../util/makeSerializable");
9const ModuleDependency = require("./ModuleDependency");
10
11/** @typedef {import("../Dependency").ReferencedExport} ReferencedExport */
12/** @typedef {import("../ModuleGraph")} ModuleGraph */
13/** @typedef {import("../util/runtime").RuntimeSpec} RuntimeSpec */
14
15class WebAssemblyExportImportedDependency extends ModuleDependency {
16 constructor(exportName, request, name, valueType) {
17 super(request);
18 /** @type {string} */
19 this.exportName = exportName;
20 /** @type {string} */
21 this.name = name;
22 /** @type {string} */
23 this.valueType = valueType;
24 }
25
26 /**
27 * Returns list of exports referenced by this dependency
28 * @param {ModuleGraph} moduleGraph module graph
29 * @param {RuntimeSpec} runtime the runtime for which the module is analysed
30 * @returns {(string[] | ReferencedExport)[]} referenced exports
31 */
32 getReferencedExports(moduleGraph, runtime) {
33 return [[this.name]];
34 }
35
36 get type() {
37 return "wasm export import";
38 }
39
40 get category() {
41 return "wasm";
42 }
43
44 serialize(context) {
45 const { write } = context;
46
47 write(this.exportName);
48 write(this.name);
49 write(this.valueType);
50
51 super.serialize(context);
52 }
53
54 deserialize(context) {
55 const { read } = context;
56
57 this.exportName = read();
58 this.name = read();
59 this.valueType = read();
60
61 super.deserialize(context);
62 }
63}
64
65makeSerializable(
66 WebAssemblyExportImportedDependency,
67 "webpack/lib/dependencies/WebAssemblyExportImportedDependency"
68);
69
70module.exports = WebAssemblyExportImportedDependency;
Note: See TracBrowser for help on using the repository browser.