mirror of
https://github.com/morluto/rea
synced 2026-10-26 06:16:17 -04:00
fix(javascript): bound semantic expansion and resolve lexical receivers
This commit is contained in:
@@ -11,6 +11,7 @@ import {
|
||||
} from "./javascriptSemanticState.js";
|
||||
import { traverseJavaScriptAst } from "./javascriptSemanticTraversal.js";
|
||||
import {
|
||||
readExactJavaScriptLiteral,
|
||||
semanticStaticPropertyKey,
|
||||
semanticStaticPropertyName,
|
||||
} from "./javascriptAstValues.js";
|
||||
@@ -262,10 +263,12 @@ export const dataEffectLiteralString = (
|
||||
| t.ArgumentPlaceholder
|
||||
| undefined,
|
||||
): string | null => {
|
||||
if (t.isStringLiteral(node)) return node.value;
|
||||
if (t.isTemplateLiteral(node) && node.expressions.length === 0)
|
||||
return node.quasis[0]?.value.cooked ?? node.quasis[0]?.value.raw ?? null;
|
||||
return null;
|
||||
if (node === undefined) return null;
|
||||
const literal = readExactJavaScriptLiteral(node);
|
||||
if (literal.found && typeof literal.value === "string") return literal.value;
|
||||
return t.isTemplateLiteral(node) && node.expressions.length === 0
|
||||
? (node.quasis[0]?.value.raw ?? null)
|
||||
: null;
|
||||
};
|
||||
|
||||
/** Read a member callee from call or construction syntax. */
|
||||
|
||||
Reference in New Issue
Block a user