diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2018-07-02 18:02:03 +0200 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2018-07-05 15:32:34 +0200 |
commit | 2aa62902447760764e7a763dea322145d9c4808c (patch) | |
tree | 88de4fc1fb1fe8cb3ff32126392a0ac889fcb0c4 /source | |
parent | bba45b330234953c0a44847cc6da65c0b8e880d8 (diff) | |
download | mupdf-2aa62902447760764e7a763dea322145d9c4808c.tar.xz |
Add stack traces to JS error messages.
Diffstat (limited to 'source')
-rw-r--r-- | source/pdf/js/util.js | 5 | ||||
-rw-r--r-- | source/pdf/js/util.js.h | 5 |
2 files changed, 10 insertions, 0 deletions
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" |