authorgravatar for kappaloris@gmail.comLoris Cro <kappaloris@gmail.com> 2022-08-02 17:15:56+02:00
committergravatar for kappaloris@gmail.comLoris Cro <kappaloris@gmail.com> 2022-08-02 17:49:36+02:00
log622714b76b6c3a21a5806e894151d6de8a7e6866
tree8586d9f8af356244cfd1c37fe54b7f2079d30ee5
parent14f0b70570aa1c50c7316851293899000615bc94

autodoc: fix frontend crash while rendering std.mem

Previously we expected to only find decl refs in a `foo.bar.baz` type of expression. This would crash when trying to render something like `@typeInfo(T).Int.bits`. We now properly account for builtins and other components.

1 files changed, 1 insertions(+), 2 deletions(-)

lib/docs/main.js+1-2
......@@ -931,8 +931,7 @@ var zigAnalysis;
931931 return exprName(switchIndex, opts);
932932 }
933933 case "refPath" : {
934 const declRef = expr.refPath[0].declRef;
935 let name = zigAnalysis.decls[declRef].name;
934 let name = exprName(expr.refPath[0]);
936935 for (let i = 1; i < expr.refPath.length; i++) {
937936 let component = undefined;
938937 if ("string" in expr.refPath[i]) {