Fix memory leak in error. Fixes #2025

This commit is contained in:
Luke Page
2014-09-06 17:23:19 +01:00
parent 6bd327b3f4
commit bc42a73886

View File

@@ -2,6 +2,8 @@ var utils = require("./utils.js");
var LessError = module.exports = function LessError(e, importManager, currentFilename) {
Error.call(this);
var filename = e.filename || currentFilename;
if (importManager && filename) {
@@ -29,5 +31,5 @@ var LessError = module.exports = function LessError(e, importManager, currentFil
this.stack = e.stack;
};
LessError.prototype = new Error();
LessError.prototype = Object.create(Error.prototype);
LessError.prototype.constructor = LessError;