فینورا پرو - سامانه جامع حسابداری و صدور فاکتور
fix(ui): capture double-quoted handlers with embedded single-quoted JavaScript arguments
davoodmehraban89 committed
Oct 30, 2026 at 23:17 UTC
1bf14ba2d853605a1729f5518e6b9be181651fbe
1 file changed
+2
-2
tests/ui-control-structure.test.mjs
+2
-2
@@ -18,9 +18,9 @@ test('Q01: every named inline view handler has an actual declared view method',
18
for (const [sourceName, source] of views) {
19
// Find only declarations in the HTML/template markup, not arbitrary test
20
// or controller calls that do not become user-facing controls.
21
- const actions = [...source.matchAll(/on(?:click|change|input|submit|mousedown|blur|focus|keyup|keydown)\s*=\s*["']([^"']+)["']/g)];
21
+ const actions = [...source.matchAll(/on(?:click|change|input|submit|mousedown|blur|focus|keyup|keydown)\s*=\s*(?:"([^"]*)"|'([^']*)')/g)];
22
for (const action of actions) {
23
- const handler = action[1].replace(/\\(["'])/g, '$1');
23
+ const handler = (action[1] || action[2] || '').replace(/\\(["'])/g, '$1');
24
for (const call of handler.matchAll(/(?:window\.)?([A-Za-z_$][\w$]*(?:View|Modal))\.([A-Za-z_$][\w$]*)\s*\(/g)) {
25
const viewName = call[1], method = call[2];
26
refs.push({sourceName, viewName, method});