Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
  • 2 commits
  • 1 file changed
  • 0 commit comments
  • 2 contributors
Commits on Sep 10, 2012
Ivo Georgiev Ivshti Update lib/introspect.js
1. The "add method" procedure does not belong in the loop that builds the signature. It is just re-defined for each new signature part.

2. Made callback optional for cases in which we do not care about the method result. E.g.
player.playPause(false);
7b8455d
Commits on Dec 21, 2012
Andrey Sidorov Merge pull request #5 from Ivshti/patch-3
Update lib/introspect.js
3849066
Showing with 20 additions and 19 deletions.
  1. +20 −19 lib/introspect.js
39 lib/introspect.js
View
@@ -51,26 +51,27 @@ module.exports = function(obj, callback) {
console.log(arg);
if (arg.direction === 'in')
signature += arg.type;
-
- // add method
- currentIface[name] = (function(ifName, methodName, signature) {
- return function() {
- var args = Array.prototype.slice.apply(arguments);
- var callback = args[args.length - 1];
- var msg = {
- destination: obj.service.name,
- path: obj.name,
- 'interface': ifName,
- member: methodName
- };
- if (signature !== '') {
- msg.signature = signature;
- msg.body = args.slice(0,-1);
- }
- bus.invoke(msg, callback);
- };
- })(ifaceName, name, signature);
}
+
+ // add method
+ currentIface[name] = (function(ifName, methodName, signature) {
+ return function() {
+ var args = Array.prototype.slice.apply(arguments);
+ var callback = (typeof(args[args.length - 1]) == "function") ? args.pop() : function() {};
+ var msg = {
+ destination: obj.service.name,
+ path: obj.name,
+ 'interface': ifName,
+ member: methodName
+ };
+ if (signature !== '') {
+ msg.signature = signature;
+ msg.body = args;
+ }
+ bus.invoke(msg, callback);
+ };
+ })(ifaceName, name, signature);
+
console.log(' method: ', name, signature);
}
for (p=0; iface.property && p < iface.property.length; ++p)

No commit comments for this range

Something went wrong with that request. Please try again.