Index: polyfill.js |
=================================================================== |
--- a/polyfill.js |
+++ b/polyfill.js |
@@ -101,33 +101,26 @@ |
// callback to the list, it won't match the signature of the function |
// and will cause an exception. |
if (typeof args[args.length - 1] == "undefined") |
args.pop(); |
let resolvePromise = null; |
let rejectPromise = null; |
- let callStack = new Error().stack; |
- |
func.call(object, ...args, result => |
{ |
let error = browser.runtime.lastError; |
if (error && !portClosedBeforeResponseError.test(error.message)) |
{ |
// runtime.lastError is already an Error instance on Edge, while on |
// Chrome it is a plain object with only a message property. |
if (!(error instanceof Error)) |
- { |
error = new Error(error.message); |
- // Add a more helpful stack trace. |
- error.stack = callStack; |
- } |
- |
rejectPromise(error); |
} |
else |
{ |
resolvePromise(result); |
} |
}); |