mirror of
https://github.com/Hopiu/annotate-extension.git
synced 2026-03-17 00:10:23 +00:00
Fixed issue with function expressions and removed newline
This commit is contained in:
parent
57b8c2cb47
commit
a455646ed2
1 changed files with 4 additions and 3 deletions
7
main.js
7
main.js
|
|
@ -86,7 +86,7 @@ define(function (require, exports, module) {
|
|||
// Look for words
|
||||
var re = /\w+/g;
|
||||
var results = txtFrom.match(re);
|
||||
|
||||
|
||||
// The first word found should be "function", and next ones parameters
|
||||
|
||||
if (results[0] === "function") {
|
||||
|
|
@ -117,7 +117,8 @@ define(function (require, exports, module) {
|
|||
prefix: getPrefix(txtFrom, results[0])
|
||||
};
|
||||
}
|
||||
else if (results[0] === "var" && results[1] === "function") {
|
||||
else if (results[0] === "var" && results[2] === "function") {
|
||||
|
||||
return {
|
||||
name: results[1],
|
||||
params: results.slice(3),
|
||||
|
|
@ -163,7 +164,7 @@ define(function (require, exports, module) {
|
|||
//output += " * @return {type} ???\n";
|
||||
output.push(" */");
|
||||
|
||||
return prefix + output.join("\n" + prefix) + "\n";
|
||||
return prefix + output.join( prefix) + "\n";
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue