Skip to content

Commit

Permalink
Merge pull request universal-ctags#3331 from jafl/javascript-always-p…
Browse files Browse the repository at this point in the history
…arse-function-block

JavaScript: always parse the contents of a function block
  • Loading branch information
masatake authored Apr 15, 2022
2 parents fc561fb + c77a1b9 commit 0d63a38
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--fields=+K
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
AnonymousFunctionf0f039f00100 input.js /^A.add('X', function(Y) {$/;" function
c input.js /^B.c = function(type, field)$/;" function function:B
d input.js /^B.d = function(id)$/;" function function:B
13 changes: 13 additions & 0 deletions Units/parser-javascript.r/js-parse-function-block.d/input.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
A.add('X', function(Y) {

B.c = function(type, field)
{
var min = 5,
is_int = (min != 'a');
};

B.d = function(id)
{
};

});
2 changes: 1 addition & 1 deletion parsers/jscript.c
Original file line number Diff line number Diff line change
Expand Up @@ -2284,7 +2284,6 @@ static bool parseStatement (tokenInfo *const token, bool is_inside_class)
makeJsTag (name, is_generator ? JSTAG_GENERATOR : JSTAG_METHOD, signature, NULL);
if ( vStringLength(secondary_name->string) > 0 )
makeFunctionTag (secondary_name, signature, is_generator);
parseBlock (token, name->string);
}
else
{
Expand All @@ -2307,6 +2306,7 @@ static bool parseStatement (tokenInfo *const token, bool is_inside_class)
if ( vStringLength(secondary_name->string) > 0 )
makeFunctionTag (secondary_name, signature, is_generator);
}
parseBlock (token, name->string);
}

vStringDelete (signature);
Expand Down

0 comments on commit 0d63a38

Please sign in to comment.