diff --git a/README.md b/README.md index 852ebff..4c8062d 100644 --- a/README.md +++ b/README.md @@ -922,6 +922,7 @@ Changes for each release. ### Version 0.0.22 + * Catch functions to not return their results to the next step. #135. * Implement loop labels. #131. * Aways flatten callback arguments. #133. diff --git a/index.js b/index.js index 0e22690..298e618 100644 --- a/index.js +++ b/index.js @@ -73,7 +73,7 @@ function cadence () { return caught }) if (!errors.uncaught) { - step[step.length - 1].call(this, errors, errors[0]) + return step[step.length - 1].call(this, errors, errors[0]) } else { throw errors } @@ -330,7 +330,7 @@ function cadence () { arguments[1] = previous.finalizers callback.apply(this, __slice.call(arguments)) } else { - //previous.callbacks = argue(__slice.call(arguments, 2)) + previous.callbacks = argue(__slice.call(arguments, 2)) invoke.apply(previous.self, previous.args) } }) diff --git a/t/cadence/errors.t.js b/t/cadence/errors.t.js index e66f9e9..bf534c8 100755 --- a/t/cadence/errors.t.js +++ b/t/cadence/errors.t.js @@ -1,6 +1,6 @@ #!/usr/bin/env node -require('proof')(19, function (equal, ok) { +require('proof')(20, function (equal, ok) { var fs = require('fs') var cadence = require('../..') var errors = [] @@ -63,7 +63,6 @@ require('proof')(19, function (equal, ok) { equal(errors[0].message, "handled", "condtionally caught regex") }])() - /* FAILING cadence([function (step) { throw new Error }, function (error) { @@ -71,7 +70,6 @@ require('proof')(19, function (equal, ok) { }], function (number) { equal(number, 1, 'handled and value changed') })() - */ cadence([function (step) { var error = new Error("handled")