Changeset - 90f99b3f2b18
[Not reviewed]
default
0 1 0
drewp@bigasterisk.com - 3 years ago 2022-06-05 01:40:17
drewp@bigasterisk.com
items() was broken; needs more typechecking or tests
1 file changed with 1 insertions and 1 deletions:
0 comments (0 inline, 0 general)
light9/web/SyncedGraph.ts
Show inline comments
 
@@ -311,25 +311,25 @@ export class SyncedGraph {
 
  }
 

	
 
  subjectStatements(s: Quad_Subject): Quad[] {
 
    this._autoDeps.askedFor(s, null, null, null);
 
    const quads = this.graph.getQuads(s, null, null, null);
 
    return quads;
 
  }
 

	
 
  items(list: any) {
 
    const out = [];
 
    let current = list;
 
    while (true) {
 
      if (current === RDF + "nil") {
 
      if (current.value === RDF + "nil") {
 
        break;
 
      }
 

	
 
      this._autoDeps.askedFor(current, null, null, null); // a little loose
 

	
 
      const firsts = this.graph.getQuads(current, RDF + "first", null, null);
 
      const rests = this.graph.getQuads(current, RDF + "rest", null, null);
 
      if (firsts.length !== 1) {
 
        throw new Error(`list node ${current} has ${firsts.length} rdf:first edges`);
 
      }
 
      out.push(firsts[0].object);
 

	
0 comments (0 inline, 0 general)