new branch

This commit is contained in:
Mark Nadal 2015-07-20 15:00:26 -07:00
parent e9e8804de8
commit ee04f3a9cd
4 changed files with 17 additions and 1 deletions

4
.gitignore vendored
View File

@ -2,4 +2,6 @@ node_modules/*
npm-debug.log
*data.json
*.db
.idea/
.idea/
*.bak
*.new

1
gun.js
View File

@ -559,6 +559,7 @@
if(!opt.end && Gun.obj.empty(delta, Gun._.meta)){ return }
if($$.key){ node = Gun.union.pseudo($.key, gun.__.key.s[$.key]) || node }
if(opt.change){ node = delta || node }
//root.console.log("ON IT BABY!", $$, node);
cb.call($$.gun || gun, Gun.obj.copy($$.field? node[$$.field] : node), $$.field || $$.at);
})(gun.__.graph[$.soul], $);
if(!opt.once){ gun.__.on($.soul).event(ctx[$.soul]) }

View File

@ -1836,6 +1836,19 @@ describe('Gun', function(){
});
})
});
it("gun put null path on put sub object", function(done){ // consensus4's bug
var gun = Gun();
//Gun.log.verbose = true;
var game = gun.put({board: null, teamA: null, teamB: null, turn: null}).key('the/game');
game.path('board').on(function(board){
console.log("board updated", board);
});
setTimeout(function(){
//game.path('board').put({11: ' ', 22: ' ', 33: 'A'});
game.put({board: {11: ' ', 22: ' ', 33: 'A'}});
},100);
});
});
describe('Streams', function(){

Binary file not shown.