commit c322eaa1bc311c2b562a12db171cfa7d8e51d5b9
parent 3aaf9e341c6595adb0b9e2060fc2d118ce5420e8
Author: Dan Stillman <dstillman@zotero.org>
Date: Thu, 5 Feb 2015 18:39:43 -0500
Restore Error workaround in Bluebird to produce proper line numbers
I didn't really investigate this, but errors from the outside world seem
to not pass the "obj instanceof Error" test due to some weirdness that
Bluebird is doing. (When I took this out recently I thought we just were
throwing some custom errors that didn't properly extend Error, but that
isn't the issue.) This restores the earlier workaround.
Diffstat:
1 file changed, 3 insertions(+), 0 deletions(-)
diff --git a/resource/bluebird.js b/resource/bluebird.js
@@ -4675,6 +4675,9 @@ function originatesFromRejection(e) {
}
function canAttachTrace(obj) {
+ // Added by Zotero
+ return obj.message && obj.stack && es5.propertyIsWritable(obj, "stack");
+
return obj instanceof Error && es5.propertyIsWritable(obj, "stack");
}