From 121b9fc090829c99c9631c67c4a83d4b68e05c69 Mon Sep 17 00:00:00 2001 From: Esteban Ordano Date: Wed, 3 Dec 2014 10:06:44 -0300 Subject: [PATCH] Fixes issues with errors --- .gitignore | 1 + lib/errors/build.js | 6 +++--- package.json | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 2d415e1..73f68bf 100644 --- a/.gitignore +++ b/.gitignore @@ -15,3 +15,4 @@ npm-debug.log apiref bower_components dist +report diff --git a/lib/errors/build.js b/lib/errors/build.js index 7130c0f..bb74176 100644 --- a/lib/errors/build.js +++ b/lib/errors/build.js @@ -14,10 +14,10 @@ var formatMessage = function(message) { var defineElement = function(fullName, baseClass, message) { return fullName + ' = function() {\n' + ' this.message = ' + formatMessage(message) + ';\n' + - ' ' + baseClass + '.call(this, this.message);\n' + - ' this.name = "' + fullName + '";\n' + + ' this.stack = (new Error()).stack;\n' + '};\n' + - 'inherits(' + fullName + ', ' + baseClass + ');\n\n'; + fullName + '.prototype = Object.create(' + baseClass + '.prototype);\n' + + fullName + '.prototype.name = "' + fullName + '";\n\n'; }; var traverseNode = function(baseClass, errorDefinition) { diff --git a/package.json b/package.json index 5ae6407..d377fee 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "test": "gulp test-all", "coverage": "gulp coverage", "build": "gulp", - "postinstall": "node_modules/gulp/bin/gulp.js browser-all" + "postinstall": "node ./lib/errors/build.js" }, "contributors": [ {