Skip to content

Commit

Permalink
πŸ› Fix getting the source code of FunctionBody instances
Browse files Browse the repository at this point in the history
  • Loading branch information
skerit committed May 2, 2024
1 parent a34072d commit ce1ad61
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions lib/parser/function_body.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,14 +105,21 @@ FunctionBody.setMethod(function getSourceCode() {

for (entry of this.content) {

if (entry.source) {
result += entry.source;

if (!entry.function_body) {
continue;
}
}

if (entry.function_body) {
result += entry.function_body.getSourceCode();
continue;
}

if (entry.source) {
result += entry.source;
continue;
if (!entry.source && entry.type == 'close_tag') {
result += '</' + entry.name.toLowerCase() + '>';
}
}

Expand Down

0 comments on commit ce1ad61

Please sign in to comment.