Skip to content

Commit

Permalink
fixed missing evaluation component bug
Browse files Browse the repository at this point in the history
  • Loading branch information
ortexx committed Jan 8, 2024
1 parent 9ce6f58 commit 9c1df94
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
4 changes: 2 additions & 2 deletions dist/akili.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "akili",
"version": "1.2.34",
"version": "1.2.35",
"description": "Akili - javascript framework",
"main": "./src/akili.js",
"author": {
Expand Down
13 changes: 13 additions & 0 deletions src/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,10 @@ export default class Component {
* @protected
*/
__createExceptionMessage(node, err) {
if(!node.__component || !node.__component.el) {
return err.stack;
}

let tagName = node.__component.el.tagName;
let attrName = node.__component.el.getAttribute('component');
let componentName = (attrName || tagName).toLowerCase();
Expand All @@ -498,6 +502,15 @@ export default class Component {
let expression;
const evalComponent = node.__attributeOf || node.__component;

if(!evalComponent || !evalComponent.__evaluationComponent) {
if (Akili.options.debug) {
// eslint-disable-next-line no-console
console.warn(`Evaluation component not found`);
}

return { res: node.__expression };
}

if (node.__component.parents(com => com.__prevent).length) {
return { res: node.__expression };
}
Expand Down

0 comments on commit 9c1df94

Please sign in to comment.