javascript: Fix scope after some constructs

This commit is contained in:
Colomban Wendling 2014-11-21 00:26:04 +01:00
parent f886f7084a
commit f158f5d362
5 changed files with 26 additions and 4 deletions

View File

@ -1243,7 +1243,6 @@ static boolean parseStatement (tokenInfo *const token, boolean is_inside_class)
{
if ( is_class )
{
vStringCopy(saveScope, token->scope);
addToScope(token, name->string);
}
else

View File

@ -159,6 +159,7 @@ test_sources = \
intro.tex \
invalid_name.f90 \
java_enum.java \
js-scope.js \
jsFunc_tutorial.js \
keyword_abstract.cs \
keyword_catch_try.cs \

18
tests/ctags/js-scope.js Normal file
View File

@ -0,0 +1,18 @@
function A() {
this.a = 1;
}
A.prototype = {
m1 : function() {
this.a = 2;
foo.bar.baz.hello(1);
foo.bar.baz.hello(2);
foo.bar.baz.hello(3);
},
m2: function() {
return this.a;
},
};

View File

@ -0,0 +1,4 @@
# format=tagmanager
AÌ1Ö0
m1Ì128ÎAÖ0
m2Ì128ÎAÖ0

View File

@ -1,6 +1,6 @@
# format=tagmanager
onInitÌ128Îapp.my_formÖ0
refreshFormÌ128Îsap.app.my_formÖ0
refreshSettlementsÌ128Îsap.app.my_formÖ0
setRefreshedÌ128Îsap.app.my_formÖ0
refreshFormÌ128Îapp.my_formÖ0
refreshSettlementsÌ128Îapp.my_formÖ0
setRefreshedÌ128Îapp.my_formÖ0
successfulRequestÌ128Îapp.my_formÖ0