summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source/pdf/js/util.js5
-rw-r--r--source/pdf/js/util.js.h5
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"