Skip to content

Commit 2e87cab

Browse files
authored
Merge pull request webpack#4544 from davegonzalez/feature/es6-refactor-entrymodulenotfounderror
ES6ify EntryModuleNotFoundError
2 parents 6b209b1 + f53cbe7 commit 2e87cab

1 file changed

Lines changed: 12 additions & 10 deletions

File tree

‎lib/EntryModuleNotFoundError.js‎

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,17 @@
22
MIT License http://www.opensource.org/licenses/mit-license.php
33
Author Tobias Koppers @sokra
44
*/
5-
function EntryModuleNotFoundError(err) {
6-
Error.call(this);
7-
this.name = "EntryModuleNotFoundError";
8-
this.message = "Entry module not found: " + err;
9-
this.details = err.details;
10-
this.error = err;
11-
Error.captureStackTrace(this, EntryModuleNotFoundError);
5+
"use strict";
6+
7+
class EntryModuleNotFoundError extends Error {
8+
constructor(err) {
9+
super();
10+
this.name = "EntryModuleNotFoundError";
11+
this.message = "Entry module not found: " + err;
12+
this.details = err.details;
13+
this.error = err;
14+
Error.captureStackTrace(this, EntryModuleNotFoundError);
15+
}
1216
}
13-
module.exports = EntryModuleNotFoundError;
1417

15-
EntryModuleNotFoundError.prototype = Object.create(Error.prototype);
16-
EntryModuleNotFoundError.prototype.constructor = EntryModuleNotFoundError;
18+
module.exports = EntryModuleNotFoundError;

0 commit comments

Comments
 (0)