[Filesystem] Change setVirtualPath method to be not enumerable 51/260951/1
authorPiotr Kosko/Tizen API (PLT) /SRPOL/Engineer/Samsung Electronics <p.kosko@samsung.com>
Wed, 7 Jul 2021 10:21:18 +0000 (12:21 +0200)
committerPiotr Kosko/Tizen API (PLT) /SRPOL/Engineer/Samsung Electronics <p.kosko@samsung.com>
Wed, 7 Jul 2021 10:21:18 +0000 (12:21 +0200)
Feature of setVirtualPath is needed for proper handling virtual paths
in thread service model - related change:
https://review.tizen.org/gerrit/gitweb?p=platform/core/api/webapi-plugins.git;a=commit;h=4870490975f9cbfa3eb16cc892f3593cb74b6668

[Verification] Code compiles without errors. Code was properly
formatted.
Checked in chrome console - setVirtualPath is not iterable, but still
accessible.

Change-Id: Ia3d2720cd1267d0a4d002538f319cfd993e83d4a

src/filesystem/js/common.js
src/filesystem/js/file_system_manager.js

index 08e2d1b..d3c17cd 100644 (file)
@@ -139,8 +139,8 @@ var commonFS_ = (function() {
     }
 
     function setVirtualPath(name, path, type, state) {
-      initCache();
-      cacheVirtualToReal[name] = { path: path, label: name, type: type, state: state };
+        initCache();
+        cacheVirtualToReal[name] = { path: path, label: name, type: type, state: state };
     }
 
     function mergeMultipleSlashes(str) {
@@ -451,6 +451,6 @@ var commonFS_ = (function() {
         getStorage: getStorage,
         getAllStorages: getAllStorages,
         mergeMultipleSlashes: mergeMultipleSlashes,
-        setVirtualPath : setVirtualPath
+        setVirtualPath: setVirtualPath
     };
 })();
index 36f74ac..ab25498 100644 (file)
@@ -36,7 +36,13 @@ function FileSystemManager() {
     var limits = native_.getResultObject(native_.callSync('FileSystemManagerGetLimits'));
     Object.defineProperties(this, {
         maxNameLength: { value: limits[0], writable: false, enumerable: true },
-        maxPathLength: { value: limits[1], writable: false, enumerable: true }
+        maxPathLength: { value: limits[1], writable: false, enumerable: true },
+        setVirtualPath: {
+            enumerable: false,
+            value: function(name, path, type, state) {
+                commonFS_.setVirtualPath(name, path, type, state);
+            }
+        }
     });
 }
 
@@ -851,8 +857,4 @@ FileSystemManager.prototype.removeStorageStateChangeListener = function() {
     removeStorageStateChangeListener.apply(this, arguments);
 };
 
-FileSystemManager.prototype.setVirtualPath = function(name, path, type, state) {
-    commonFS_.setVirtualPath(name, path, type, state);
-};
-
 exports = new FileSystemManager();