[BE] Even more permissive ref annotation comment

Allow `readOnly` and `writable` or even `WriTaBlE`. 

commit-id:f6f77fd8
This commit is contained in:
Xuan Huang (黄玄)
2022-10-05 18:42:16 -04:00
parent a574d15985
commit b605fc1ab3
@@ -22,7 +22,7 @@ export default {
};
const ANNOTATIONS_IMMUT = ["immut", "readonly"];
const ANNOTATIONS_MUT = ["mut", "mutable"];
const ANNOTATIONS_MUT = ["mut", "mutable", "writable"];
/**
* Eventually, we probably want to move RefKind refinements
@@ -195,7 +195,7 @@ function refineUses(
function hasLeadingComment(path: NodePath, annotation: string): boolean {
return (
path.node.leadingComments?.some(
(comment) => comment.value.trim() === annotation
(comment) => comment.value.trim().toLowerCase() === annotation
) ?? false
);
}