File tree Expand file tree Collapse file tree 9 files changed +25
-80
lines changed Expand file tree Collapse file tree 9 files changed +25
-80
lines changed Original file line number Diff line number Diff line change @@ -29,26 +29,6 @@ class CommentCompilationWarning extends WebpackError {
29
29
30
30
Error . captureStackTrace ( this , this . constructor ) ;
31
31
}
32
-
33
- serialize ( context ) {
34
- const { write } = context ;
35
-
36
- write ( this . name ) ;
37
- write ( this . module ) ;
38
- write ( this . loc ) ;
39
-
40
- super . serialize ( context ) ;
41
- }
42
-
43
- deserialize ( context ) {
44
- const { read } = context ;
45
-
46
- this . name = read ( ) ;
47
- this . module = read ( ) ;
48
- this . loc = read ( ) ;
49
-
50
- super . serialize ( context ) ;
51
- }
52
32
}
53
33
54
34
makeSerializable (
Original file line number Diff line number Diff line change @@ -57,9 +57,6 @@ class ModuleBuildError extends WebpackError {
57
57
serialize ( context ) {
58
58
const { write } = context ;
59
59
60
- write ( this . name ) ;
61
- write ( this . details ) ;
62
- write ( this . module ) ;
63
60
write ( this . error ) ;
64
61
65
62
super . serialize ( context ) ;
@@ -68,9 +65,6 @@ class ModuleBuildError extends WebpackError {
68
65
deserialize ( context ) {
69
66
const { read } = context ;
70
67
71
- this . name = read ( ) ;
72
- this . details = read ( ) ;
73
- this . module = read ( ) ;
74
68
this . error = read ( ) ;
75
69
76
70
super . deserialize ( context ) ;
Original file line number Diff line number Diff line change @@ -41,21 +41,15 @@ class ModuleError extends WebpackError {
41
41
serialize ( context ) {
42
42
const { write } = context ;
43
43
44
- write ( this . name ) ;
45
- write ( this . module ) ;
46
44
write ( this . error ) ;
47
- write ( this . details ) ;
48
45
49
46
super . serialize ( context ) ;
50
47
}
51
48
52
49
deserialize ( context ) {
53
50
const { read } = context ;
54
51
55
- this . name = read ( ) ;
56
- this . module = read ( ) ;
57
52
this . error = read ( ) ;
58
- this . details = read ( ) ;
59
53
60
54
super . deserialize ( context ) ;
61
55
}
Original file line number Diff line number Diff line change @@ -63,9 +63,6 @@ class ModuleParseError extends WebpackError {
63
63
serialize ( context ) {
64
64
const { write } = context ;
65
65
66
- write ( this . name ) ;
67
- write ( this . module ) ;
68
- write ( this . loc ) ;
69
66
write ( this . error ) ;
70
67
71
68
super . serialize ( context ) ;
@@ -74,15 +71,12 @@ class ModuleParseError extends WebpackError {
74
71
deserialize ( context ) {
75
72
const { read } = context ;
76
73
77
- this . name = read ( ) ;
78
- this . module = read ( ) ;
79
- this . loc = read ( ) ;
80
74
this . error = read ( ) ;
81
75
82
76
super . deserialize ( context ) ;
83
77
}
84
78
}
85
79
86
- makeSerializable ( ModuleParseError , "webpack/lib/dependencies/ ModuleParseError" ) ;
80
+ makeSerializable ( ModuleParseError , "webpack/lib/ModuleParseError" ) ;
87
81
88
82
module . exports = ModuleParseError ;
Original file line number Diff line number Diff line change @@ -41,21 +41,15 @@ class ModuleWarning extends WebpackError {
41
41
serialize ( context ) {
42
42
const { write } = context ;
43
43
44
- write ( this . name ) ;
45
- write ( this . module ) ;
46
44
write ( this . warning ) ;
47
- write ( this . details ) ;
48
45
49
46
super . serialize ( context ) ;
50
47
}
51
48
52
49
deserialize ( context ) {
53
50
const { read } = context ;
54
51
55
- this . name = read ( ) ;
56
- this . module = read ( ) ;
57
52
this . warning = read ( ) ;
58
- this . details = read ( ) ;
59
53
60
54
super . deserialize ( context ) ;
61
55
}
Original file line number Diff line number Diff line change @@ -39,7 +39,6 @@ const makeSerializable = require("./util/makeSerializable");
39
39
/** @typedef {import("./Module").SourceContext } SourceContext */
40
40
/** @typedef {import("./RequestShortener") } RequestShortener */
41
41
/** @typedef {import("./RuntimeTemplate") } RuntimeTemplate */
42
- /** @typedef {import("./WebpackError") } WebpackError */
43
42
/** @typedef {import("./util/createHash").Hash } Hash */
44
43
45
44
const EARLY_RETURN_ERROR = new Error ( "flags early return is not an error" ) ;
@@ -69,6 +68,12 @@ class NonErrorEmittedError extends WebpackError {
69
68
}
70
69
}
71
70
71
+ makeSerializable (
72
+ NonErrorEmittedError ,
73
+ "webpack/lib/NormalModule" ,
74
+ "NonErrorEmittedError"
75
+ ) ;
76
+
72
77
/**
73
78
* @typedef {Object } CachedSourceEntry
74
79
* @property {TODO } source the generated source
Original file line number Diff line number Diff line change @@ -27,28 +27,6 @@ class UnsupportedFeatureWarning extends WebpackError {
27
27
28
28
Error . captureStackTrace ( this , this . constructor ) ;
29
29
}
30
-
31
- serialize ( context ) {
32
- const { write } = context ;
33
-
34
- write ( this . name ) ;
35
- write ( this . module ) ;
36
- write ( this . loc ) ;
37
- write ( this . hideStack ) ;
38
-
39
- super . serialize ( context ) ;
40
- }
41
-
42
- deserialize ( context ) {
43
- const { read } = context ;
44
-
45
- this . name = read ( ) ;
46
- this . module = read ( ) ;
47
- this . loc = read ( ) ;
48
- this . hideStack = read ( ) ;
49
-
50
- super . deserialize ( context ) ;
51
- }
52
30
}
53
31
54
32
makeSerializable (
Original file line number Diff line number Diff line change @@ -22,6 +22,8 @@ class WebpackError extends Error {
22
22
this . module = undefined ;
23
23
/** @type {DependencyLocation } */
24
24
this . loc = undefined ;
25
+ /** @type {boolean } */
26
+ this . hideStack = undefined ;
25
27
26
28
Error . captureStackTrace ( this , this . constructor ) ;
27
29
}
@@ -30,26 +32,24 @@ class WebpackError extends Error {
30
32
return this . stack + ( this . details ? `\n${ this . details } ` : "" ) ;
31
33
}
32
34
33
- serialize ( context ) {
34
- const { write } = context ;
35
-
35
+ serialize ( { write } ) {
36
+ write ( this . name ) ;
37
+ write ( this . message ) ;
38
+ write ( this . stack ) ;
36
39
write ( this . details ) ;
37
40
write ( this . missing ) ;
38
- write ( this . module ) ;
39
41
write ( this . loc ) ;
40
-
41
- super . serialize ( context ) ;
42
+ write ( this . hideStack ) ;
42
43
}
43
44
44
- deserialize ( context ) {
45
- const { read } = context ;
46
-
45
+ deserialize ( { read } ) {
46
+ this . name = read ( ) ;
47
+ this . message = read ( ) ;
48
+ this . stack = read ( ) ;
47
49
this . details = read ( ) ;
48
50
this . missing = read ( ) ;
49
- this . module = read ( ) ;
50
51
this . loc = read ( ) ;
51
-
52
- super . deserialize ( context ) ;
52
+ this . hideStack = read ( ) ;
53
53
}
54
54
}
55
55
Original file line number Diff line number Diff line change 6
6
"use strict" ;
7
7
8
8
const WebpackError = require ( "../WebpackError" ) ;
9
+ const makeSerializable = require ( "../util/makeSerializable" ) ;
9
10
10
11
class CriticalDependencyWarning extends WebpackError {
11
12
constructor ( message ) {
@@ -18,4 +19,9 @@ class CriticalDependencyWarning extends WebpackError {
18
19
}
19
20
}
20
21
22
+ makeSerializable (
23
+ CriticalDependencyWarning ,
24
+ "webpack/lib/dependencies/CriticalDependencyWarning"
25
+ ) ;
26
+
21
27
module . exports = CriticalDependencyWarning ;
You can’t perform that action at this time.
0 commit comments