From 916893a7b157fc4ca599ad60b771d26777affcce Mon Sep 17 00:00:00 2001 From: "Piotr Kosko/Tizen API (PLT) /SRPOL/Engineer/Samsung Electronics" Date: Wed, 7 Jul 2021 12:21:18 +0200 Subject: [PATCH] [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 --- src/filesystem/js/common.js | 6 +++--- src/filesystem/js/file_system_manager.js | 12 +++++++----- 2 files changed, 10 insertions(+), 8 deletions(-) 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(); -- 2.34.1