Skip to content

Commit f5824ee

Browse files
committed
fix(compiler): skip object methods in property-site matching
Object shorthand methods (node.method === true) whose key matches a PROPERTY_SITES entry (read, put, remove, of, creates, patches, removes) were incorrectly treated as contract argument positions. This caused site() to run mentionsContract on the FunctionExpression, false-report DATA_CONTRACT_ARGUMENT, and skip walking the body—dropping real contract uses inside.
1 parent 5c6f32a commit f5824ee

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎packages/octane/src/compiler/data-contracts.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ export function analyzeDataContracts(source, filename) {
316316
walk(node.body, node, 'body', visit);
317317
return false;
318318
}
319-
if (node.type === 'Property' && !node.computed) {
319+
if (node.type === 'Property' && !node.computed && !node.method) {
320320
const name = node.key.name ?? node.key.value;
321321
if (PROPERTY_SITES.has(name)) {
322322
if (site(node.value, name)) walk(node.value, node, 'value', visit);

0 commit comments

Comments
 (0)