MCPcopy Create free account
hub / github.com/OpenEndedGroup/Field2 / explore

Function explore

lib/web/tern/infer.js:1019–1035  ·  view source on GitHub ↗
(aval, path, depth)

Source from the content-addressed store, hash-verified

1017 target = asArray = targetInner.getProp("<i>");
1018
1019 function explore(aval, path, depth) {
1020 if (depth > 3 || !aval.forward) return;
1021 for (var i = 0; i < aval.forward.length; ++i) {
1022 var prop = aval.forward[i].propagatesTo();
1023 if (!prop) continue;
1024 var newPath = path, dest;
1025 if (prop instanceof AVal) {
1026 dest = prop;
1027 } else if (prop.target instanceof AVal) {
1028 newPath += prop.pathExt;
1029 dest = prop.target;
1030 } else continue;
1031 if (dest == target) return newPath;
1032 var found = explore(dest, newPath, depth + 1);
1033 if (found) return found;
1034 }
1035 }
1036
1037 var foundPath = explore(fn.self, "!this", 0);
1038 for (var i = 0; !foundPath && i < fn.args.length; ++i)

Callers 1

maybeTagAsGenericFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected