Comparing version 0.10.0 to 0.10.1-SNAPSHOT
@@ -5,2 +5,7 @@ # babble history | ||
## 2016-02-16, version 0.11.0 | ||
- Replaced `instanceof MyClass` checks with `object.isMyClass` checks. | ||
## 2014-08-18, version 0.10.0 | ||
@@ -7,0 +12,0 @@ |
@@ -218,3 +218,3 @@ 'use strict'; | ||
// validate actor | ||
['ask', 'tell', 'listen'].forEach(function (prop) { | ||
['ask', 'tell', 'listen', 'listenOnce'].forEach(function (prop) { | ||
if (actor[prop] !== undefined) { | ||
@@ -240,3 +240,4 @@ throw new Error('Conflict: actor already has a property "' + prop + '"'); | ||
babbler._receive(message); | ||
receiveOriginal.call(actor, from, message); | ||
// TODO: only propagate to receiveOriginal if the message is not handled by the babbler | ||
return receiveOriginal.call(actor, from, message); | ||
}; | ||
@@ -246,3 +247,3 @@ } | ||
actor[receiveName] = function (from, message) { | ||
babbler._receive(message); | ||
return babbler._receive(message); | ||
}; | ||
@@ -262,3 +263,3 @@ } | ||
babbler: babbler, | ||
receive: receiveOriginal, | ||
receiveOriginal: receiveOriginal, | ||
receiveName: receiveName | ||
@@ -289,5 +290,5 @@ }; | ||
// restore any original receive method | ||
if (__babbler__.receive) { | ||
actor[__babbler__.receiveName] = __babbler__.receive; | ||
// restore any original receiveOriginal method | ||
if (__babbler__.receiveOriginal) { | ||
actor[__babbler__.receiveName] = __babbler__.receiveOriginal; | ||
} | ||
@@ -294,0 +295,0 @@ } |
@@ -36,2 +36,5 @@ 'use strict'; | ||
// type information | ||
Babbler.prototype.isBabbler = true; | ||
/** | ||
@@ -38,0 +41,0 @@ * Connect to a message bus |
@@ -12,2 +12,5 @@ 'use strict'; | ||
// type information | ||
Block.prototype.isBlock = true; | ||
/** | ||
@@ -14,0 +17,0 @@ * Execute the block |
@@ -73,3 +73,3 @@ 'use strict'; | ||
if (choices && (choices instanceof Function)) { | ||
if (choices && (typeof choices === 'function')) { | ||
throw new TypeError('Parameter choices must be an object'); | ||
@@ -93,2 +93,5 @@ } | ||
// type information | ||
Decision.prototype.isDecision = true; | ||
/** | ||
@@ -137,3 +140,3 @@ * Execute the block | ||
if (!(block instanceof Block)) { | ||
if (!block || !block.isBlock) { | ||
throw new TypeError('Block expected as choice'); | ||
@@ -140,0 +143,0 @@ } |
@@ -48,3 +48,3 @@ 'use strict'; | ||
if (condition instanceof Function) { | ||
if (typeof condition === 'function') { | ||
this.condition = condition; | ||
@@ -63,7 +63,7 @@ } | ||
if (trueBlock && !(trueBlock instanceof Block)) { | ||
if (trueBlock && !trueBlock.isBlock) { | ||
throw new TypeError('Parameter trueBlock must be a Block'); | ||
} | ||
if (falseBlock && !(falseBlock instanceof Block)) { | ||
if (falseBlock && !falseBlock.isBlock) { | ||
throw new TypeError('Parameter falseBlock must be a Block'); | ||
@@ -79,2 +79,5 @@ } | ||
// type information | ||
IIf.prototype.isIIf = true; | ||
/** | ||
@@ -81,0 +84,0 @@ * Execute the block |
@@ -24,2 +24,5 @@ 'use strict'; | ||
// type information | ||
Listen.prototype.isListen = true; | ||
/** | ||
@@ -26,0 +29,0 @@ * Execute the block |
@@ -35,2 +35,5 @@ 'use strict'; | ||
// type information | ||
Tell.prototype.isTell = true; | ||
/** | ||
@@ -37,0 +40,0 @@ * Execute the block |
@@ -32,2 +32,5 @@ 'use strict'; | ||
// type information | ||
Then.prototype.isThen = true; | ||
/** | ||
@@ -70,3 +73,3 @@ * Execute the block | ||
if (!(next instanceof Block)) { | ||
if (!next || !next.isBlock) { | ||
throw new TypeError('Parameter next must be a Block or function'); | ||
@@ -73,0 +76,0 @@ } |
@@ -32,2 +32,5 @@ var uuid = require('node-uuid'); | ||
// type information | ||
Conversation.prototype.isConversation = true; | ||
/** | ||
@@ -34,0 +37,0 @@ * Send a message |
{ | ||
"name": "babble", | ||
"version": "0.10.0", | ||
"version": "0.10.1-SNAPSHOT", | ||
"description": "Dynamic communication flows between message based actors.", | ||
@@ -16,6 +16,6 @@ "author": "Jos de Jong <wjosdejong@gmail.com> (https://github.com/josdejong)", | ||
"dependencies": { | ||
"es6-promise": "^1.0.0", | ||
"node-uuid": "~1.4.1", | ||
"pubnub": "~3.6.7", | ||
"pubsub-js": "~1.4.0" | ||
"es6-promise": "^3.1.2", | ||
"node-uuid": "~1.4.7", | ||
"pubnub": "~3.9.2", | ||
"pubsub-js": "~1.5.3" | ||
}, | ||
@@ -22,0 +22,0 @@ "devDependencies": { |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 2 instances in 1 package
Debug access
Supply chain riskUses debug, reflection and dynamic code execution features.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
1636972
23957
16
5
+ Addedes6-promise@3.3.1(transitive)
+ Addedlodash@4.17.21(transitive)
+ Addedpubnub@3.9.2(transitive)
+ Addedpubsub-js@1.5.8(transitive)
- Removedes6-promise@1.0.0(transitive)
- Removedpubnub@3.6.8(transitive)
- Removedpubsub-js@1.4.2(transitive)
Updatedes6-promise@^3.1.2
Updatednode-uuid@~1.4.7
Updatedpubnub@~3.9.2
Updatedpubsub-js@~1.5.3