Permalink
Browse files

cosmetics: indentation on server's PrivateCell class

  • Loading branch information...
1 parent fc02c04 commit 7ba7c37cdf15e0668b8be3f7298e3cc0a6dfd47e Montana Rowe committed Feb 28, 2012
Showing with 30 additions and 29 deletions.
  1. +30 −29 chat_app/server.js
View
@@ -5,6 +5,7 @@
// servers
// connect
// socket.io
+// PrivateCell
// users
// setUser
// getUser
@@ -49,35 +50,35 @@ var io = sio.listen(
function PrivateCell(val){
- var value = {val: val};
- function set(val){
- var result = get();
- value.val = val;
- return result;
- }
- function get(){
- return value.val;
- }
- function getKey(key){
- return get()[key];
- }
- function setKey(key, val){
- var result = getKey(key);
- get()[key] = val;
- return result;
- }
- function delKey(key){
- var result = getKey(key);
- var got = get();
- if(key in got)
- delete got[key];
- return result;
- }
- this.set = set;
- this.get = get;
- this.getKey = getKey;
- this.setKey = setKey;
- this.delKey = delKey;
+ var value = {val: val};
+ function get(){
+ return value.val;
+ }
+ function getKey(key){
+ return get()[key];
+ }
+ function set(val){
+ var result = get();
+ value.val = val;
+ return result;
+ }
+ function setKey(key, val){
+ var result = getKey(key);
+ get()[key] = val;
+ return result;
+ }
+ function delKey(key){
+ var result = getKey(key);
+ var got = get();
+ if(key in got)
+ delete got[key];
+ return result;
+ }
+ this.set = set;
+ this.get = get;
+ this.getKey = getKey;
+ this.setKey = setKey;
+ this.delKey = delKey;
}
var users = new PrivateCell({});
var setUser = users.setKey;

0 comments on commit 7ba7c37

Please sign in to comment.