return dbus error on javascript exception
authorLuc Yriarte <luc.yriarte@intel.com>
Wed, 15 May 2013 08:34:25 +0000 (10:34 +0200)
committerLuc Yriarte <luc.yriarte@intel.com>
Wed, 15 May 2013 08:34:25 +0000 (10:34 +0200)
cloudeebus/cloudeebus.js

index 0d48bcf..1d57b8b 100644 (file)
@@ -262,9 +262,10 @@ cloudeebus.Service.prototype._addMethod = function(objectPath, ifName, method, o
                objectJS.wrapperFunc[method] = function() {
                        var result;
                        var methodId = arguments[0];
+                       var callDict = {};
+                       // affectation of callDict in eval, otherwise dictionary(='{}') interpreted as block of code by eval
+                       eval("callDict = " + arguments[1]);
                        try {
-                               // affectation of callDict in eval, otherwise dictionary(='{}') interpreted as block of code by eval
-                               eval("var callDict = " + arguments[1]);
                                result = funcToCall.apply(objectJS, callDict.args);
                                service._returnMethod(methodId, callDict.callIndex, true, result);
                        }