Skip to content

Commit 109db05

Browse files
authored
Merge pull request webpack#8738 from hiroppy/feature/modify-WebpackError.unittest
make use of `nodejs.util.inspect.custom`
2 parents 74b8aac + 2fdcff3 commit 109db05

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/WebpackError.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
*/
55
"use strict";
66

7+
const inspect = require("util").inspect.custom;
8+
79
class WebpackError extends Error {
810
/**
911
* Creates an instance of WebpackError.
@@ -21,7 +23,7 @@ class WebpackError extends Error {
2123
Error.captureStackTrace(this, this.constructor);
2224
}
2325

24-
inspect() {
26+
[inspect]() {
2527
return this.stack + (this.details ? `\n${this.details}` : "");
2628
}
2729
}

0 commit comments

Comments
 (0)