summaryrefslogtreecommitdiffstats
path: root/spec/env/common.js
diff options
context:
space:
mode:
Diffstat (limited to 'spec/env/common.js')
-rw-r--r--spec/env/common.js10
1 files changed, 5 insertions, 5 deletions
diff --git a/spec/env/common.js b/spec/env/common.js
index 2a24db2..e378052 100644
--- a/spec/env/common.js
+++ b/spec/env/common.js
@@ -61,12 +61,12 @@ global.shouldThrow = function(callback, type, msg) {
try {
callback();
failed = true;
- } catch (err) {
- if (type && !(err instanceof type)) {
- throw new AssertError('Type failure: ' + err);
+ } catch (caught) {
+ if (type && !(caught instanceof type)) {
+ throw new AssertError('Type failure: ' + caught);
}
- if (msg && !(msg.test ? msg.test(err.message) : msg === err.message)) {
- throw new AssertError('Throw mismatch: Expected ' + err.message + ' to match ' + msg + '\n\n' + err.stack, shouldThrow);
+ if (msg && !(msg.test ? msg.test(caught.message) : msg === caught.message)) {
+ throw new AssertError('Throw mismatch: Expected ' + caught.message + ' to match ' + msg + '\n\n' + caught.stack, shouldThrow);
}
}
if (failed) {