Skip to content

Commit

Permalink
JavaScript: don't choke on array lists
Browse files Browse the repository at this point in the history
  • Loading branch information
b4n committed Aug 3, 2014
1 parent 3c2d93e commit bc9b2fa
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tagmanager/ctags/js.c
Expand Up @@ -660,6 +660,10 @@ static void findCmdTerm (tokenInfo *const token)
{
skipArgumentList(token);
}
else if ( isType (token, TOKEN_OPEN_SQUARE) )
{
skipArrayList(token);
}
else
{
readToken (token);
Expand Down
1 change: 1 addition & 0 deletions tests/ctags/Makefile.am
Expand Up @@ -14,6 +14,7 @@ test_sources = \
68hc11.asm \
angle_bracket.cpp \
anonymous_functions.php \
arraylist.js \
array_ref_and_out.cs \
array_spec.f90 \
array-spec.f90 \
Expand Down
20 changes: 20 additions & 0 deletions tests/ctags/arraylist.js
@@ -0,0 +1,20 @@

var a = [];
var b = [1, 2, 3];
var c = [
{ a: "hello", b: 42 },
{ a: "hi", b: 41 }
];

var class = function() {
this.test1 = {
foo: [ 1, 2, 3],
bar: [ 4, 5, 9]
};
// FIXME: no tag is generated for test2
this.test2 = [
{ a: {}, b: {} },
{ a: {}, b: {} }
];
this.test3 = function() {}
}
9 changes: 9 additions & 0 deletions tests/ctags/arraylist.js.tags
@@ -0,0 +1,9 @@
# format=tagmanager
a�16384�0
b�16384�0
bar�64�class.test1�0
c�16384�0
class�1�0
foo�64�class.test1�0
test1�1�class�0
test3�128�class�0

0 comments on commit bc9b2fa

Please sign in to comment.