mirror of https://github.com/webpack/webpack.git
Merge pull request #3677 from willmendesneto/refactor-chunk-render-error
refactor(ChunkRenderError): upgrade to ES6
This commit is contained in:
commit
49a31729ae
|
|
@ -2,17 +2,24 @@
|
|||
MIT License http://www.opensource.org/licenses/mit-license.php
|
||||
Author Tobias Koppers @sokra
|
||||
*/
|
||||
function ChunkRenderError(chunk, file, error) {
|
||||
Error.call(this);
|
||||
Error.captureStackTrace(this, ChunkRenderError);
|
||||
this.name = "ChunkRenderError";
|
||||
this.error = error;
|
||||
this.message = error.message;
|
||||
this.details = error.stack;
|
||||
this.file = file;
|
||||
this.chunk = chunk;
|
||||
}
|
||||
module.exports = ChunkRenderError;
|
||||
"use strict";
|
||||
|
||||
ChunkRenderError.prototype = Object.create(Error.prototype);
|
||||
ChunkRenderError.prototype.constructor = ChunkRenderError;
|
||||
class ChunkRenderError extends Error {
|
||||
|
||||
constructor(chunk, file, error) {
|
||||
super();
|
||||
|
||||
if(Error.hasOwnProperty("captureStackTrace")) {
|
||||
Error.captureStackTrace(this, this.constructor);
|
||||
}
|
||||
|
||||
this.name = "ChunkRenderError";
|
||||
this.error = error;
|
||||
this.message = error.message;
|
||||
this.details = error.stack;
|
||||
this.file = file;
|
||||
this.chunk = chunk;
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = ChunkRenderError;
|
||||
|
|
|
|||
Loading…
Reference in New Issue