Skip to content

Commit d1b6610

Browse files
committed
Fixing random bugs introduced during refactoreing (in sync with r826)
1 parent 4ca20fd commit d1b6610

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+4304
-826
lines changed

bin/jsdocs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
#!/usr/bin/env narwhal
2-
require('jsdocs/jsdocs').main(system.args);
2+
require('jsdocs').main(system.args);

lib/gnosis/parser.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
var implementation = require("gnosis/parser-platform");
2-
for (var member in implementation) exports[member] = implementation[member];
2+
for (var member in implementation) exports[member] = implementation[member];

lib/jsdocs.js

+164
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,164 @@
1+
/**
2+
@overview
3+
@date $Date$
4+
@version $Revision$
5+
@location $HeadURL$
6+
*/
7+
8+
/**
9+
This is the main container for the JSDOC application.
10+
*/
11+
12+
var parser = exports.optionsParser = new (require("args").Parser)();
13+
var jsdoc = require("./jsdocs/js-doc");
14+
15+
var version = "3.0.0";
16+
parser.usage("jsdocs [OPTIONS] <SRC_DIR> <SRC_FILE> ...");
17+
parser.help("[OPTIONS]");
18+
parser.option("-d", "--directory", "destination")
19+
.help("Output to this directory (defaults to \"out\").")
20+
.def("out")
21+
.set();
22+
parser.option("-t", "--template", "template")
23+
.help("Relative path to the template used for formating the output.")
24+
.set();
25+
parser.option("-a", "--all", "allfunctions")
26+
.help("Include all functions, even undocumented ones.")
27+
.bool();
28+
parser.option("--include-anoymus", "ignoreAnonymous")
29+
.help("Include all functions, even anonymus ones.")
30+
.def(true)
31+
.set(false);
32+
parser.option("--explain", "explain")
33+
.help("Explain ??") // TODO: put better help message
34+
.def(false)
35+
.set(true);
36+
parser.option("--underscore-is-not-private", "treatUnderscoredAsPrivate")
37+
.help("Don't treat properties starting with underscore as privates.")
38+
.def(true)
39+
.set(false);
40+
parser.option("-c", "--config", "conf")
41+
.help("Load a configuration file.")
42+
.set();
43+
parser.option("-D", "--define", "define")
44+
.help("-D=\"myVar:My value\" or --define=\"myVar:'My value'\"\n" +
45+
"Multiple. Define a variable, available in JsDoc as JSDOC.opt.D.myVar.")
46+
.set();
47+
parser.option("-e", "--encoding", "encoding")
48+
.help("-e=<ENCODING> or --encoding=<ENCODING>\n" +
49+
"Use this encoding to read and write files.")
50+
.def("utf-8")
51+
.set();
52+
parser.option("-E", "--exclude", "exclude")
53+
.help("-E=\"REGEX\" or --exclude=\"REGEX\"\n" +
54+
"Multiple. Exclude files based on the supplied regex.")
55+
.def([])
56+
.action(collection);
57+
parser.option("-n", "--nocode", "ignoreCode")
58+
.help("Ignore all code, only document comments with @name tags.")
59+
.def(false)
60+
.set(true);
61+
parser.option("-o", "--out", "out")
62+
.help("Print log messages to a file (defaults to stdout).")
63+
.set();
64+
parser.option("-p", "--private", "includePrivates")
65+
.help("Include symbols tagged as private, underscored and inner symbols.")
66+
.def(false)
67+
.set(true);
68+
parser.option("-q", "--quiet", "quiet")
69+
.help("Do not output any messages, not even warnings.")
70+
.def(false)
71+
.set(true);
72+
parser.option("-r", "--recurse", "recurse")
73+
.help("Descend into src directories.")
74+
.integer()
75+
.def(1)
76+
.set();
77+
parser.option("-s", "--suppress", "includeSource")
78+
.help("Suppress source code output.")
79+
.def(false)
80+
.set(true);
81+
parser.option("-S", "--securemodules", "securemodules")
82+
.help("Use Secure Modules mode to parse source code.")
83+
.def(false)
84+
.set(true);
85+
parser.option("-T", "--test", "test")
86+
.help("Run all unit tests and exit.")
87+
.action(function() {
88+
print("run tests");
89+
});
90+
parser.option("-u", "--unique", "destination")
91+
.help("Force file names to be unique, but not based on symbol names.")
92+
.def(false)
93+
.set(true);
94+
parser.option("-v", "--verbose", "verbose")
95+
.help("Provide verbose feedback about what is happening.")
96+
.def(false)
97+
.set(true);
98+
parser.option("-x", "--ext", "extensions")
99+
.help("-x=<EXT>[,EXT]... or --ext=<EXT>[,EXT]...\n" +
100+
"Scan source files with the given extensions separated by \":\" (defaults to .js)")
101+
.def([".js"])
102+
.action(collection);
103+
parser.option("--version", "version")
104+
.help("print jsdoc-toolkit version number and exit.")
105+
.action(function() {
106+
this.print(version);
107+
this.exit();
108+
});
109+
parser.option("-h", "--help")
110+
.action(parser.printHelp);
111+
112+
exports.main = function main(args) {
113+
var options = exports.options = parser.parse(args);
114+
if (options.args.length > 1) {
115+
parser.printHelp(options);
116+
parser.exit(options);
117+
} else {
118+
collection(options, "src", options.args[0]);
119+
jsdoc.doc(options);
120+
}
121+
}
122+
123+
/**
124+
utility function used by arguments parser that splits
125+
arguments into subarguments.
126+
@param {Object} options object containing options that parser will return
127+
@param {String} name options name that being parsed
128+
@param {String} value value that being parsed
129+
*/
130+
function collection(options, name, value) {
131+
options[name] = value.split(",");
132+
}
133+
134+
if (require.main === module.id) exports.main(args)
135+
/**
136+
@requires Opt
137+
138+
if (typeof arguments == "undefined") arguments = [];
139+
JSDOC.opt = Opt.get(
140+
arguments,
141+
{
142+
a: "allfunctions",
143+
c: "conf",
144+
d: "directory",
145+
"D[]": "define",
146+
e: "encoding",
147+
"E[]": "exclude",
148+
h: "help",
149+
n: "nocode",
150+
o: "out",
151+
p: "private",
152+
q: "quiet",
153+
r: "recurse",
154+
S: "securemodules",
155+
s: "suppress",
156+
t: "template",
157+
T: "testmode",
158+
u: "unique",
159+
v: "verbose",
160+
x: "ext"
161+
}
162+
);
163+
164+

lib/jsdocs/JSDOC.js renamed to lib/jsdocs/dep.JSDOC.js

-20
Original file line numberDiff line numberDiff line change
@@ -1654,26 +1654,6 @@ JSDOC.SymbolSet.prototype.walk = function(symbol) {
16541654
}
16551655

16561656

1657-
1658-
1659-
/**
1660-
@constructor
1661-
*/
1662-
JSDOC.Token = function(data, type, name) {
1663-
this.data = data;
1664-
this.type = type;
1665-
this.name = name;
1666-
}
1667-
1668-
JSDOC.Token.prototype.toString = function() {
1669-
return "<"+this.type+" name=\""+this.name+"\">"+this.data+"</"+this.type+">";
1670-
}
1671-
1672-
JSDOC.Token.prototype.is = function(what) {
1673-
return this.name === what || this.type === what;
1674-
}
1675-
1676-
16771657
/**
16781658
@class Search a {@link JSDOC.TextStream} for language tokens.
16791659
*/
File renamed without changes.

lib/jsdocs/frame.js

+19-24
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,25 @@
11
/** A few helper functions to make life a little easier. */
22

3-
function defined(o) {
4-
return (o !== undefined);
5-
}
6-
exports.defined = defined;
3+
exports.defined = function defined(o) {
4+
return (o !== undefined);
5+
};
76

8-
function copy(o) { // todo check for circular refs
9-
if (o == null || typeof(o) != 'object') return o;
10-
var c = new o.constructor();
11-
for(var p in o) c[p] = copy(o[p]);
12-
return c;
13-
}
14-
exports.copy = copy;
7+
exports.copy = function copy(o) { // todo check for circular refs
8+
if (o == null || typeof(o) != 'object') return o;
9+
var c = new o.constructor();
10+
for(var p in o) c[p] = copy(o[p]);
11+
return c;
12+
};
1513

16-
function isUnique(arr) {
17-
var l = arr.length;
18-
for(var i = 0; i < l; i++ ) {
19-
if (arr.lastIndexOf(arr[i]) > i) return false;
20-
}
21-
return true;
22-
}
23-
exports.isUnique = isUnique;
14+
exports.isUnique = function isUnique(arr) {
15+
var l = arr.length;
16+
for(var i = 0; i < l; i++ ) {
17+
if (arr.lastIndexOf(arr[i]) > i) return false;
18+
}
19+
return true;
20+
};
2421

25-
(function() {
2622
/** Returns the given string with all regex meta characters backslashed. */
27-
RegExp.escapeMeta = function(str) {
28-
return str.replace(/([$^\\\/()|?+*\[\]{}.-])/g, "\\$1");
29-
}
30-
})();
23+
exports.escapeMeta = RegExp.escapeMeta = function escapeMeta(str) {
24+
return str.replace(/([$^\\\/()|?+*\[\]{}.-])/g, "\\$1");
25+
};

0 commit comments

Comments
 (0)