Change the order of arguments

This commit is contained in:
Hiroki Uchikawa
2018-05-23 11:42:53 +09:00
committed by HirokiUchikawa
parent 84f598e143
commit 7fafa21a1b
6 changed files with 72 additions and 73 deletions

View File

@@ -145,12 +145,12 @@ function createContext(id,seed) {
obj.get = function(key) {
var keyPath = parseKey(key);
var context = getContextStorage(keyPath.storage);
return context.get(keyPath.key, scope);
return context.get(scope, keyPath.key);
};
obj.set = function(key, value) {
var keyPath = parseKey(key);
var context = getContextStorage(keyPath.storage);
return context.set(keyPath.key, value, scope);
return context.set(scope, keyPath.key, value);
};
obj.keys = function(storage) {
//TODO: discuss about keys() behavior

View File

@@ -66,7 +66,7 @@ var localfilesystem = {
storageBaseDir = configs.dir;
}
},
get: function (key, scope) {
get: function (scope, key) {
if(!storages[scope]){
createStorage(scope);
}
@@ -82,7 +82,7 @@ var localfilesystem = {
}
},
set: function (key, value, scope) {
set: function (scope, key, value) {
if(!storages[scope]){
createStorage(scope);
}

View File

@@ -17,19 +17,18 @@
var util = require("../../util");
var data;
var seedFlg = false;
var memory = {
init: function(config) {
data = {};
},
get: function(key, scope) {
get: function(scope, key) {
if(!data[scope]){
data[scope] = {};
}
return util.getMessageProperty(data[scope],key);
},
set: function(key, value, scope) {
set: function(scope, key, value) {
if(!data[scope]){
data[scope] = {};
}