Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions context.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,10 @@ Namespace.prototype.run = function (fn) {
return context;
}
catch (exception) {
if (exception) {
try {
exception[ERROR_SYMBOL] = context;
}
catch (e) {}
throw exception;
}
finally {
Expand Down Expand Up @@ -84,9 +85,10 @@ Namespace.prototype.bind = function (fn, context) {
return fn.apply(this, arguments);
}
catch (exception) {
if (exception) {
try {
exception[ERROR_SYMBOL] = context;
}
catch (e) {}
throw exception;
}
finally {
Expand Down Expand Up @@ -161,7 +163,7 @@ Namespace.prototype.bindEmitter = function (emitter) {
* @param {Error} exception Possibly annotated error.
*/
Namespace.prototype.fromException = function (exception) {
return exception[ERROR_SYMBOL];
return exception && exception[ERROR_SYMBOL];
};

function get(name) {
Expand Down