Skip to content

Commit 324ae15

Browse files
committed
Fix bug in CircuitManager
This bug was introduced by removing the parsing from 8fa4df9 It looks like these tests are not currently running on the CI which was how we were able to find the issue.
1 parent 9455b40 commit 324ae15

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

src/Components/Web.JS/src/Platform/Circuits/CircuitManager.ts

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -91,15 +91,13 @@ function getComponentStartComment(node: Node): StartComponentComment | undefined
9191
return {
9292
node: node as Comment,
9393
circuitId,
94-
rendererId: rendererId,
95-
componentId: componentId,
94+
rendererId: Number.parseInt(rendererId),
95+
componentId: Number.parseInt(componentId),
9696
};
97-
} else {
98-
throw new Error(`Found malformed start component comment at ${node.textContent}`);
9997
}
10098
} catch (error) {
101-
throw new Error(`Found malformed start component comment at ${node.textContent}`);
10299
}
100+
throw new Error(`Found malformed start component comment at ${node.textContent}`);
103101
}
104102
}
105103
}
@@ -122,12 +120,10 @@ function getComponentEndComment(component: StartComponentComment, children: Node
122120
const componentId = Number.parseInt(rawComponentId);
123121
if (componentId === component.componentId) {
124122
return { componentId, node: node as Comment, index: i };
125-
} else {
126-
throw new Error(`Found malformed end component comment at ${node.textContent}`);
127123
}
128124
} catch (error) {
129-
throw new Error(`Found malformed end component comment at ${node.textContent}`);
130125
}
126+
throw new Error(`Found malformed end component comment at ${node.textContent}`);
131127
}
132128
throw new Error(`End component comment not found for ${component.node}`);
133129
}

0 commit comments

Comments
 (0)