From: Piotr Kosko/Tizen API (PLT) /SRPOL/Engineer/Samsung Electronics
Date: Wed, 7 Jul 2021 10:21:18 +0000 (+0200)
Subject: [Filesystem] Change setVirtualPath method to be not enumerable
X-Git-Tag: submit/tizen/20210708.092104~1
X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=916893a7b157fc4ca599ad60b771d26777affcce;p=platform%2Fcore%2Fapi%2Fwebapi-plugins.git
[Filesystem] Change setVirtualPath method to be not enumerable
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
---
diff --git a/src/filesystem/js/common.js b/src/filesystem/js/common.js
index 08e2d1be..d3c17cd3 100644
--- a/src/filesystem/js/common.js
+++ b/src/filesystem/js/common.js
@@ -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
};
})();
diff --git a/src/filesystem/js/file_system_manager.js b/src/filesystem/js/file_system_manager.js
index 36f74ac0..ab25498f 100644
--- a/src/filesystem/js/file_system_manager.js
+++ b/src/filesystem/js/file_system_manager.js
@@ -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();