fix(core): Handle item and items correctly in js task runner

This commit is contained in:
Tomi Turtiainen 2024-11-08 20:43:21 +02:00
parent 0fdb79a270
commit 269879fe09
2 changed files with 12 additions and 0 deletions

View file

@ -62,6 +62,15 @@ describe('BuiltInsParser', () => {
expect(state).toEqual(new BuiltInsParserState({ needs$input: true })); expect(state).toEqual(new BuiltInsParserState({ needs$input: true }));
}); });
test.each([['items'], ['item']])(
'should mark input as needed when %s is used',
(identifier) => {
const state = parseAndExpectOk(`return ${identifier};`);
expect(state).toEqual(new BuiltInsParserState({ needs$input: true }));
},
);
}); });
describe('$(...)', () => { describe('$(...)', () => {

View file

@ -131,6 +131,9 @@ export class BuiltInsParser {
state.markExecutionAsNeeded(); state.markExecutionAsNeeded();
} else if (node.name === '$prevNode') { } else if (node.name === '$prevNode') {
state.markPrevNodeAsNeeded(); state.markPrevNodeAsNeeded();
} else if (node.name === 'items' || node.name === 'item') {
// item is deprecated but we still need to support it
state.markInputAsNeeded();
} }
}; };