marko 6.0.35 → 6.0.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/translator/index.js +6 -2
- package/package.json +1 -1
package/dist/translator/index.js
CHANGED
@@ -797,7 +797,6 @@ function getExprRoot(path5) {
|
|
797
797
|
function getFnRoot(path5) {
|
798
798
|
let curPath = path5;
|
799
799
|
let fnPath;
|
800
|
-
if (curPath.isProgram()) return;
|
801
800
|
while (!isMarko(curPath)) {
|
802
801
|
if (isFunction(curPath)) {
|
803
802
|
fnPath = curPath;
|
@@ -809,7 +808,12 @@ function getFnRoot(path5) {
|
|
809
808
|
break;
|
810
809
|
}
|
811
810
|
}
|
812
|
-
|
811
|
+
const parentPath = curPath.parentPath;
|
812
|
+
if (parentPath) {
|
813
|
+
curPath = parentPath;
|
814
|
+
} else {
|
815
|
+
break;
|
816
|
+
}
|
813
817
|
}
|
814
818
|
return fnPath;
|
815
819
|
}
|