diff --git a/packages/chameleon-linter/checkers/script.js b/packages/chameleon-linter/checkers/script.js index f265f23f127743c8cdae22304a3785cc6272e54a..ad9b8b5ad8e9961043e67ecc0dd39efcbe443ef9 100644 --- a/packages/chameleon-linter/checkers/script.js +++ b/packages/chameleon-linter/checkers/script.js @@ -93,7 +93,7 @@ function getCompClassDef(ast) { }; } else if (nameArg.isIdentifier()) { let argBinding = nameArg.scope.getBinding(nameArg.node.name); - let possibleInit = argBinding.path.node.init; + let possibleInit = argBinding ? argBinding.path.node.init : null; // For now, we only check just one jump along its scope chain. if (possibleInit && possibleInit.type === 'StringLiteral') { event = { diff --git a/packages/cml-js-parser/src/visitors/containerPathVisitor.js b/packages/cml-js-parser/src/visitors/containerPathVisitor.js index c99594c294c1172ac1c3c427118d058373001cb8..999528bd740be0d3134cbc60008272419fbfb66a 100644 --- a/packages/cml-js-parser/src/visitors/containerPathVisitor.js +++ b/packages/cml-js-parser/src/visitors/containerPathVisitor.js @@ -159,7 +159,7 @@ module.exports.containerPathVisitor = function(path) { }); } else if (nameArg.isIdentifier()) { let argBinding = nameArg.scope.getBinding(nameArg.node.name); - let possibleInit = argBinding.path.node.init; + let possibleInit = argBinding ? argBinding.path.node.init : null; // For now, we only check just one jump along its scope chain. if (possibleInit && possibleInit.type === 'StringLiteral') { results.events.push({