Attempt at normalizing error stacks across browsers.

Failed expectations now have a `stack` property, remove `trace.stack`
This commit is contained in:
Dan Hansen and Davis W. Frank
2013-02-27 16:37:31 -08:00
parent dc4563d45c
commit d6da13a8dd
12 changed files with 237 additions and 132 deletions

View File

@@ -71,18 +71,21 @@
}
};
var exceptionFormatter = jasmine.exceptionFormatter;
var specConstructor = jasmine.Spec;
var getSpecName = function(spec, currentSuite) {
return currentSuite.getFullName() + ' ' + spec.description + '.';
};
var buildExpectationResult = jasmine.buildExpectationResult;
var expectationResultFactory = function(attrs) {
return buildExpectationResult(attrs);
};
// TODO: we may just be able to pass in the fn instead of wrapping here
var buildExpectationResult = jasmine.buildExpectationResult,
exceptionFormatter = new jasmine.ExceptionFormatter(),
expectationResultFactory = function(attrs) {
attrs.messageFormatter = exceptionFormatter.message;
attrs.stackFormatter = exceptionFormatter.stack;
return buildExpectationResult(attrs);
};
// TODO: fix this naming, and here's where the value comes in
this.catchExceptions = function(value) {