Permalink
Browse files

gate-executor 1.1.1, resolves #517

1 parent 43ad8d3 commit d56deb0208d90537c32b7bfd1fab6c30c96e064f @rjrodger rjrodger committed Oct 18, 2016
Showing with 11 additions and 9 deletions.
  1. +1 −1 package.json
  2. +10 −7 seneca.js
  3. +0 −1 test/close.test.js
View
@@ -77,7 +77,7 @@
"dependencies": {
"archy": "1.0.0",
"eraro": "0.4.1",
- "gate-executor": "1.1.0",
+ "gate-executor": "1.1.1",
"gex": "0.2.2",
"jsonic": "0.2.2",
"json-stringify-safe": "5.0.1",
View
@@ -656,7 +656,14 @@ function make_seneca (initial_options) {
var raw_pattern = args.pattern
- var action = args.action || function action (msg, done) {
+ var pattern = self.util.clean(raw_pattern)
+
+ if (!_.keys(pattern)) {
+ throw internals.error('add_empty_pattern', {args: Common.clean(args)})
+ }
+
+
+ var action = args.action || function default_action (msg, done) {
done.call(this, null, msg.default$ || null)
}
@@ -688,12 +695,6 @@ function make_seneca (initial_options) {
var internal_catchall = (raw_pattern.internal$ && raw_pattern.internal$.catchall !== null)
? !!raw_pattern.internal$.catchall : !!so.internal.catchall
- var pattern = self.util.clean(raw_pattern)
-
- if (!_.keys(pattern)) {
- throw internals.error('add_empty_pattern', {args: Common.clean(args)})
- }
-
var pattern_rules = _.clone(action.validate || {})
_.each(pattern, function (v, k) {
if (_.isObject(v)) {
@@ -718,6 +719,7 @@ function make_seneca (initial_options) {
// Canonical object form of the action pattern.
actmeta.msgcanon = Jsonic(actmeta.pattern)
+
var priormeta = self.find(pattern)
if (priormeta) {
@@ -790,6 +792,7 @@ function make_seneca (initial_options) {
}
}
+
function modify_action (seneca, actmeta) {
_.each(private$.action_modifiers, function (actmod) {
actmeta = actmod.call(seneca, actmeta)
View
@@ -44,7 +44,6 @@ describe('close', function () {
tmp.sc = 1
})
.close(function () {
- console.log('tmp.sc', tmp.sc)
expect(1).to.equal(tmp.sc)
done()
})

0 comments on commit d56deb0

Please sign in to comment.