Skip to content

Commit

Permalink
chore(empower): rebuild web bundle
Browse files Browse the repository at this point in the history
  • Loading branch information
twada committed Sep 30, 2014
1 parent 53e882e commit ddebf3c
Showing 1 changed file with 19 additions and 15 deletions.
34 changes: 19 additions & 15 deletions build/empower.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ function decorate (callSpec, decorator) {
thisObj = callSpec.thisObj,
numArgsToCapture = callSpec.numArgsToCapture;

return function () {
return function decoratedAssert () {
var context, message, args = slice.apply(arguments);

if (args.every(isNotCaptured)) {
Expand Down Expand Up @@ -235,29 +235,33 @@ Decorator.prototype.concreteAssert = function (invocation, context) {
};

Decorator.prototype.errorToRethrow = function (e, originalMessage, context) {
var f;
var f, attrs;
if (e.name !== 'AssertionError') {
return e;
}
if (typeof this.receiver.AssertionError !== 'function') {
return e;
}
if (isPhantom) {
f = new this.receiver.AssertionError({
actual: e.actual,
expected: e.expected,
operator: e.operator,
message: e.message
});

attrs = {
actual: e.actual,
expected: e.expected,
operator: e.operator,
message: e.message
};

if (this.config.modifyMessageOnRethrow) {
attrs.message = this.buildPowerAssertText(originalMessage, context);
attrs.stackStartFunction = Decorator.prototype.concreteAssert;
}

if (isPhantom || this.config.modifyMessageOnRethrow) {
f = new this.receiver.AssertionError(attrs);
} else {
f = e;
f.message = attrs.message;
}
if (this.config.modifyMessageOnRethrow) {
f.message = this.buildPowerAssertText(originalMessage, context);
if (typeof e.generatedMessage !== 'undefined') {
f.generatedMessage = false;
}
}

if (this.config.saveContextOnRethrow) {
f.powerAssertContext = context;
}
Expand Down

0 comments on commit ddebf3c

Please sign in to comment.