kick-blanking, context variables, and bidirectional key/set set/key load/set working!

This commit is contained in:
Mark Nadal 2015-01-22 04:22:48 -07:00
parent 1ded3ca5eb
commit a23dd0e5cb
2 changed files with 14 additions and 2 deletions

2
gun.js
View File

@ -411,7 +411,6 @@
if(!gun._.field){ if(!gun._.field){
Gun.obj.map(gun._.keys, function(yes, key){ Gun.obj.map(gun._.keys, function(yes, key){
if(yes){ return } if(yes){ return }
console.log("setting fields", key, yes);
gun.key(key); gun.key(key);
}); });
} }
@ -640,7 +639,6 @@
(chain._ = chain._ || {})[where] = chain._[where] || []; (chain._ = chain._ || {})[where] = chain._[where] || [];
chain.$[where] = chain.$[where] || function(fn){ chain.$[where] = chain.$[where] || function(fn){
if(chain.args){ if(chain.args){
//console.log("shoot!", chain.args);
fn.apply(chain, chain.args); fn.apply(chain, chain.args);
} else { } else {
(chain._[where]||[]).push(fn); (chain._[where]||[]).push(fn);

View File

@ -354,6 +354,20 @@ describe('Gun', function(){
}); });
}); });
it('load path empty set', function(done){
gun.load('hello/world').path('earth').set('mars').get(function(val){
expect(val).to.be('mars');
done();
});
});
it('load path get', function(done){
gun.load('hello/world').path('earth').get(function(val){
expect(val).to.be('mars');
done();
});
});
it('key set get', function(done){ it('key set get', function(done){
gun.key('world/hello').set({world: "hello"}).get(function(val){ gun.key('world/hello').set({world: "hello"}).get(function(val){
expect(val.world).to.be('hello'); expect(val.world).to.be('hello');