mirror of
https://github.com/morluto/rea.git
synced 2026-11-06 23:06:18 +00:00
fix(javascript): own reference roles and invocation result identities
This commit is contained in:
1 parent
990d1de4d0
commit
965aff805d
8 files changed
+212
-72
No files matched your search
@@ -51,3 +51,12 @@ export const semanticCallableResultExpressions = (
|
||||
}
|
||||
return output;
|
||||
};
|
||||
|
||||
/** A callable's direct invocation result differs from its body result syntax. */
|
||||
export const semanticCallableResultKind = (
|
||||
callable: t.Node,
|
||||
): "value" | "promise" | "iterator" | "async-iterator" => {
|
||||
if (!t.isFunction(callable)) return "value";
|
||||
if (callable.generator) return callable.async ? "async-iterator" : "iterator";
|
||||
return callable.async ? "promise" : "value";
|
||||
};
|
||||
Reference in new issue
Block a user