ripple-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t...@apache.org
Subject incubator-ripple git commit: Catch unhandled ScanditSDK calls and log them.
Date Mon, 19 Oct 2015 18:33:24 GMT
Repository: incubator-ripple
Updated Branches:
  refs/heads/master 3a1d8892a -> e2c2f848e


Catch unhandled ScanditSDK calls and log them.

If a call to a function in a plugin does not exist, an error will be displayed. This disrupts
the application flow. Therefore we implement the known calls and just log them as a warning
to the console of the browser.

This closes #67


Project: http://git-wip-us.apache.org/repos/asf/incubator-ripple/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ripple/commit/e2c2f848
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ripple/tree/e2c2f848
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ripple/diff/e2c2f848

Branch: refs/heads/master
Commit: e2c2f848e83bd1c0ef52c85f406902ea8240152a
Parents: 3a1d889
Author: Leo von Klenze <devel@leo-von-klenze.de>
Authored: Sat Jul 18 13:21:17 2015 +0200
Committer: Tim Barham <tim.barham@microsoft.com>
Committed: Mon Oct 19 11:33:18 2015 -0700

----------------------------------------------------------------------
 lib/client/platform/cordova/3.0.0/bridge/scanditsdk.js | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ripple/blob/e2c2f848/lib/client/platform/cordova/3.0.0/bridge/scanditsdk.js
----------------------------------------------------------------------
diff --git a/lib/client/platform/cordova/3.0.0/bridge/scanditsdk.js b/lib/client/platform/cordova/3.0.0/bridge/scanditsdk.js
index 9d597fa..9f47cb1 100644
--- a/lib/client/platform/cordova/3.0.0/bridge/scanditsdk.js
+++ b/lib/client/platform/cordova/3.0.0/bridge/scanditsdk.js
@@ -81,6 +81,14 @@ module.exports = {
                 }
             ]
         });
-
     }
 };
+
+['start', 'stop', 'cancel', 'pause', 'resume', 'resize', 'torch'].forEach(function(name)
{
+    module.exports[name] = function() {
+        var messages = ['No emulation method found for ScanditSDK call [', name, '] called
with:'];
+        messages.push(arguments);
+        console.warn.apply(console, messages);
+    };
+});
+


Mime
View raw message