source: imaps-frontend/node_modules/webpack/lib/dependencies/ImportContextDependency.js@ 79a0317

main
Last change on this file since 79a0317 was 79a0317, checked in by stefan toskovski <stefantoska84@…>, 3 days ago

F4 Finalna Verzija

  • 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 ContextDependency = require("./ContextDependency");
10const ContextDependencyTemplateAsRequireCall = require("./ContextDependencyTemplateAsRequireCall");
11
12/** @typedef {import("../javascript/JavascriptParser").Range} Range */
13/** @typedef {import("../serialization/ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */
14/** @typedef {import("../serialization/ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */
15
16class ImportContextDependency extends ContextDependency {
17 /**
18 * @param {TODO} options options
19 * @param {Range} range range
20 * @param {Range} valueRange value range
21 */
22 constructor(options, range, valueRange) {
23 super(options);
24
25 this.range = range;
26 this.valueRange = valueRange;
27 }
28
29 get type() {
30 return `import() context ${this.options.mode}`;
31 }
32
33 get category() {
34 return "esm";
35 }
36
37 /**
38 * @param {ObjectSerializerContext} context context
39 */
40 serialize(context) {
41 const { write } = context;
42
43 write(this.valueRange);
44
45 super.serialize(context);
46 }
47
48 /**
49 * @param {ObjectDeserializerContext} context context
50 */
51 deserialize(context) {
52 const { read } = context;
53
54 this.valueRange = read();
55
56 super.deserialize(context);
57 }
58}
59
60makeSerializable(
61 ImportContextDependency,
62 "webpack/lib/dependencies/ImportContextDependency"
63);
64
65ImportContextDependency.Template = ContextDependencyTemplateAsRequireCall;
66
67module.exports = ImportContextDependency;
Note: See TracBrowser for help on using the repository browser.