[Pkg-javascript-commits] [less.js] 112/285: Fix memory leak in error. Fixes #2025

Jonas Smedegaard dr at jones.dk
Mon Oct 26 23:23:44 UTC 2015


This is an automated email from the git hooks/post-receive script.

js pushed a commit to annotated tag v2.0.0
in repository less.js.

commit bc42a738868c1f48f71bf3899bbdb20b8e3dbf82
Author: Luke Page <luke.a.page at gmail.com>
Date:   Sat Sep 6 17:23:19 2014 +0100

    Fix memory leak in error. Fixes #2025
---
 lib/less/less-error.js | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lib/less/less-error.js b/lib/less/less-error.js
index e21bd57..6978116 100644
--- a/lib/less/less-error.js
+++ b/lib/less/less-error.js
@@ -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;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/less.js.git



More information about the Pkg-javascript-commits mailing list