Skip to content

Commit 7c09a4d

Browse files
committed
a couple more fixes that were initially missed
1 parent ff96f71 commit 7c09a4d

4 files changed

Lines changed: 6 additions & 8 deletions

File tree

lib/UnsupportedFeatureWarning.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ class UnsupportedFeatureWarning extends Error {
88

99
constructor(module, message) {
1010
super();
11-
if(Error.hasOwnProperty("captureStackTrace")) {
12-
Error.captureStackTrace(this, this.constructor);
13-
}
11+
1412
this.name = "UnsupportedFeatureWarning";
1513
this.message = message;
1614
this.origin = this.module = module;
15+
16+
Error.captureStackTrace(this, this.constructor);
1717
}
1818
}
1919

lib/WebpackOptionsValidationError.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,7 @@ class WebpackOptionsValidationError extends Error {
5858
validationErrors.map(err => " - " + indent(WebpackOptionsValidationError.formatValidationError(err), " ", false)).join("\n");
5959
this.validationErrors = validationErrors;
6060

61-
if(Error.hasOwnProperty("captureStackTrace")) {
62-
Error.captureStackTrace(this, this.constructor);
63-
}
61+
Error.captureStackTrace(this, this.constructor);
6462
}
6563

6664
static formatSchema(schema, prevSchemas) {

lib/performance/EntrypointsOverSizeLimitWarning.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ const SizeFormatHelpers = require("../SizeFormatHelpers");
88
module.exports = class EntrypointsOverSizeLimitWarning extends Error {
99
constructor(entrypoints, entrypointLimit) {
1010
super();
11-
Error.captureStackTrace(this, this.constructor);
1211
this.name = "EntrypointsOverSizeLimitWarning";
1312
this.entrypoints = entrypoints;
1413
const entrypointList = this.entrypoints.map(entrypoint => `\n ${
@@ -20,5 +19,6 @@ module.exports = class EntrypointsOverSizeLimitWarning extends Error {
2019
}`).join();
2120
this.message = `entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (${SizeFormatHelpers.formatSize(entrypointLimit)}). This can impact web performance.
2221
Entrypoints:${entrypointList}`;
22+
Error.captureStackTrace(this, this.constructor);
2323
}
2424
};

lib/performance/NoAsyncChunksWarning.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
module.exports = class NoAsyncChunksWarning extends Error {
88
constructor() {
99
super();
10-
Error.captureStackTrace(this, this.constructor);
1110
this.name = "NoAsyncChunksWarning";
1211
this.message = "webpack performance recommendations: \n" +
1312
"You can limit the size of your bundles by using import() or require.ensure to lazy load some parts of your application.\n" +
1413
"For more info visit https://webpack.js.org/guides/code-splitting/";
14+
Error.captureStackTrace(this, this.constructor);
1515
}
1616
};

0 commit comments

Comments
 (0)