Skip to content

Commit 9a00479

Browse files
committed
WIP: fixes after rebasing
1 parent 47eba06 commit 9a00479

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

src/database/core/Repo.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@ const INTERRUPT_REASON = 'repo_interrupt';
3434
* A connection to a single data repository.
3535
*/
3636
export class Repo {
37-
/** @type {!Database} */
38-
database: Database;
3937
dataUpdateCount = 0;
4038
private infoSyncTree_: SyncTree;
4139
private serverSyncTree_: SyncTree;
@@ -51,6 +49,7 @@ export class Repo {
5149
private abortTransactions_: (path: Path) => Path;
5250
private rerunTransactions_: (changedPath: Path) => Path;
5351
private interceptServerDataCallback_: ((a: string, b: any) => void) | null = null;
52+
private __database: Database;
5453

5554
// A list of data pieces and paths to be set when this client disconnects.
5655
private onDisconnect_ = new SparseSnapshotTree();
@@ -553,5 +552,9 @@ export class Repo {
553552
});
554553
}
555554
}
555+
556+
get database(): Database {
557+
return this.__database || (this.__database = new Database(this));
558+
}
556559
}
557560

src/database/core/WriteTree.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -385,8 +385,8 @@ export class WriteTree {
385385
if (!toIterate.isEmpty() && !toIterate.isLeafNode()) {
386386
const nodes = [];
387387
const cmp = index.getCompare();
388-
const iter = reverse ? (toIterateas ChildrenNode).getReverseIteratorFrom(startPost, index) :
389-
(toIterateas ChildrenNode).getIteratorFrom(startPost, index);
388+
const iter = reverse ? (toIterate as ChildrenNode).getReverseIteratorFrom(startPost, index) :
389+
(toIterate as ChildrenNode).getIteratorFrom(startPost, index);
390390
let next = iter.getNext();
391391
while (next && nodes.length < count) {
392392
if (cmp(next, startPost) !== 0) {

src/database/core/util/SortedMap.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ export class LLRBNode<K, V> {
303303
} else {
304304
smallest = (n.right as LLRBNode<K,V>).min_();
305305
n = n.copy(smallest.key, smallest.value, null, null,
306-
(n.rightas LLRBNode<K,V>).removeMin_());
306+
(n.right as LLRBNode<K,V>).removeMin_());
307307
}
308308
}
309309
n = n.copy(null, null, null, null, n.right.remove(key, comparator));

0 commit comments

Comments
 (0)