annotate-extension
annotate-extension copied to clipboard
Not finding functions
When I run annotate, I always get the alert "no functions found". I consistently use expressions (foo = function() {}) rather than function declarations. Is that the reason, or is something else going on? Thanks, Robert
It also doesn't process public functions like this.fn = function(){}
Thanks.
You can add the following code which solves the "this" issue:
else if(results[0] === "this" && results[2] === "function"){
return {
name: results[1],
params: results.slice(3),
prefix: getPrefix(txtFrom, results[0])
};
}
I consistently use expressions like { functionName : function(){ ..} }
but when I run annotate, I always get the alert "no functions found" .The following code solve the issue
else if (results[1] === "function") {
return {
name: results[0],
params: results.slice(2),
prefix: getPrefix(txtFrom, results[0])
};
}
Added with #25
it doesnt recognise functions with spaces between parameters eg: "function exec(a, b, c)" is not found, but "function exec(a,b,c)" is. the regex needs to be modified.
Expressions like this :
var test = fucntion (c, d){ ..}
does not recognize