From 2aa62902447760764e7a763dea322145d9c4808c Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Mon, 2 Jul 2018 18:02:03 +0200 Subject: Add stack traces to JS error messages. --- source/pdf/js/util.js | 5 +++++ source/pdf/js/util.js.h | 5 +++++ 2 files changed, 10 insertions(+) (limited to 'source') diff --git a/source/pdf/js/util.js b/source/pdf/js/util.js index e2c00169..03e4a61b 100644 --- a/source/pdf/js/util.js +++ b/source/pdf/js/util.js @@ -1,3 +1,8 @@ +Error.prototype.toString = function() { + if (this.stackTrace) return this.name + ': ' + this.message + this.stackTrace; + return this.name + ': ' + this.message; +}; + var MuPDF = { monthPattern: /Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec/, monthName: [ diff --git a/source/pdf/js/util.js.h b/source/pdf/js/util.js.h index 9ef529dc..de27f97d 100644 --- a/source/pdf/js/util.js.h +++ b/source/pdf/js/util.js.h @@ -1,3 +1,8 @@ +"Error.prototype.toString = function() {\n" +"if (this.stackTrace) return this.name + ': ' + this.message + this.stackTrace;\n" +"return this.name + ': ' + this.message;\n" +"};\n" +"\n" "var MuPDF = {\n" "monthPattern: /Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec/,\n" "monthName: [\n" -- cgit v1.2.3