From 2844cb3bb53567665f0f3b4c3fb6bbd59c30a56c Mon Sep 17 00:00:00 2001 From: "Alexey Mulyukin (alexprey)" Date: Mon, 24 Aug 2020 14:27:20 +0300 Subject: [PATCH] Fix issue #32 --- lib/v3/parser.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/lib/v3/parser.js b/lib/v3/parser.js index 8fb83fb..26fbcf1 100644 --- a/lib/v3/parser.js +++ b/lib/v3/parser.js @@ -267,6 +267,10 @@ class Parser extends EventEmitter { if (expressionNode.type === 'CallExpression') { const callee = expressionNode.callee; + if (expressionNode.arguments) { + this.parseBodyRecursively(expressionNode.arguments, parseContext, level + 1); + } + if (callee.type === 'Identifier' && this.dispatcherNames.indexOf(callee.name) >= 0) { const eventItem = this.parseEventDeclaration(expressionNode); @@ -288,6 +292,10 @@ class Parser extends EventEmitter { if (node.type === 'CallExpression') { const callee = node.callee; + if (node.arguments) { + this.parseBodyRecursively(node.arguments, parseContext, level + 1); + } + if (callee.type === 'Identifier' && this.dispatcherNames.includes(callee.name)) { const eventItem = this.parseEventDeclaration(node); @@ -311,6 +319,10 @@ class Parser extends EventEmitter { if (initNode.type === 'CallExpression') { const callee = initNode.callee; + if (initNode.arguments) { + this.parseBodyRecursively(initNode.arguments, parseContext, level + 1); + } + if (callee.type === 'Identifier' && this.dispatcherConstructorNames.includes(callee.name)) { this.dispatcherNames.push(variable.name); } @@ -354,6 +366,10 @@ class Parser extends EventEmitter { if (initNode.type === 'CallExpression') { const callee = initNode.callee; + if (initNode.arguments) { + this.parseBodyRecursively(initNode.arguments, parseContext, level + 1); + } + if (callee.type === 'Identifier' && this.dispatcherConstructorNames.includes(callee.name)) { this.dispatcherNames.push(variable.name); }