source: imaps-frontend/node_modules/webpack/lib/dependencies/RequireResolveContextDependency.js

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

F4 Finalna Verzija

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