[Utils] NativeManager.prototype.callIfPossible
authorPawel Kaczmarek <p.kaczmarek3@samsung.com>
Tue, 16 Dec 2014 09:00:44 +0000 (10:00 +0100)
committerRafal Galka <r.galka@samsung.com>
Tue, 16 Dec 2014 13:18:16 +0000 (22:18 +0900)
Change-Id: I040b44f2ede0e82f8f4f2021b4a95cb066fd9f45
Signed-off-by: Pawel Kaczmarek <p.kaczmarek3@samsung.com>
src/utils/utils_api.js

index ec24a169f9849c681dab43b574343ed98686900c..07b260bd7c1accf0da31f7e7aa66190b9a4e9c8b 100644 (file)
@@ -809,6 +809,12 @@ NativeManager.prototype.getErrorObject = function(result) {
   return new tizen.WebAPIException(result.error.code, result.error.message, result.error.name);
 };
 
+NativeManager.prototype.callIfPossible = function(callback) {
+  if (!_type.isNullOrUndefined(callback)) {
+    callback.apply(callback, [].slice.call(arguments, 1));
+  }
+};
+
 /*
  *bridge is a two way communication interface
  *Example usage: