Commit 913a9ebf authored by mcmlxxix's avatar mcmlxxix
Browse files

fixed client splice() method, removed broken db shadow object stuff (may...

fixed client splice() method, removed broken db shadow object stuff (may result in fragments of shadow objects being left behind in the case of a splice)
parent 02d0043f
...@@ -20,6 +20,8 @@ load("json-sock.js"); ...@@ -20,6 +20,8 @@ load("json-sock.js");
- JSONClient.write(scope,location,lock); - JSONClient.write(scope,location,lock);
- JSONClient.push(scope,location,lock); - JSONClient.push(scope,location,lock);
- JSONClient.unshift(scope,location,lock); - JSONClient.unshift(scope,location,lock);
- JSONClient.splice(scope,location,start,end,data,lock)
- JSONClient.slice(scope,location,start,end,lock)
- JSONClient.lock(scope,location,lock); - JSONClient.lock(scope,location,lock);
- JSONClient.unlock(scope,location); - JSONClient.unlock(scope,location);
- JSONClient.subscribe(scope,location); - JSONClient.subscribe(scope,location);
...@@ -200,7 +202,8 @@ function JSONClient(serverAddr,serverPort) { ...@@ -200,7 +202,8 @@ function JSONClient(serverAddr,serverPort) {
lock:lock, lock:lock,
timeout:this.settings.TIMEOUT timeout:this.settings.TIMEOUT
}); });
return this.wait(); if(this.settings.TIMEOUT >= 0)
return this.wait(this.settings.TIMEOUT);
} }
/* read multiple object data (lock for reading or writing, blocking) */ /* read multiple object data (lock for reading or writing, blocking) */
......
...@@ -359,8 +359,8 @@ function JSONdb (fileName, scope) { ...@@ -359,8 +359,8 @@ function JSONdb (fileName, scope) {
record.data[record.property].splice(request.data.start,request.data.num,request.data.data); record.data[record.property].splice(request.data.start,request.data.num,request.data.data);
/* remove existing shadow records that have been replaced by new data */ /* remove existing shadow records that have been replaced by new data */
record.shadow[record.property].splice(request.data.start,request.data.num,new Shadow()); // if(record.shadow[record.property] instanceof Array)
// record.shadow[record.property].splice(request.data.start,request.data.num,new Shadow());
/* populate this object's children with shadow objects */ /* populate this object's children with shadow objects */
composite_sketch(record.data[record.property][request.data.start],record.shadow[record.property][request.data.start]); composite_sketch(record.data[record.property][request.data.start],record.shadow[record.property][request.data.start]);
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment