sproutcore 1.6.0.rc.1-x86-mingw32 → 1.6.0.rc.2-x86-mingw32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (217) hide show
  1. data/CHANGELOG +31 -6
  2. data/{History.txt → History.rdoc} +0 -0
  3. data/{README.txt → README.rdoc} +3 -2
  4. data/Rakefile +15 -15
  5. data/{Todo.txt → Todo.rdoc} +0 -0
  6. data/VERSION.yml +1 -1
  7. data/lib/buildtasks/manifest.rake +11 -4
  8. data/lib/buildtasks/target.rake +20 -23
  9. data/lib/frameworks/sproutcore/CHANGELOG.md +36 -0
  10. data/lib/frameworks/sproutcore/frameworks/core_foundation/core.js +2 -42
  11. data/lib/frameworks/sproutcore/frameworks/core_foundation/ext/handlebars/bind.js +2 -1
  12. data/lib/frameworks/sproutcore/frameworks/core_foundation/ext/handlebars/collection.js +3 -1
  13. data/lib/frameworks/sproutcore/frameworks/core_foundation/mixins/template_helpers/checkbox_support.js +5 -5
  14. data/lib/frameworks/sproutcore/frameworks/core_foundation/mixins/template_helpers/text_field_support.js +29 -12
  15. data/lib/frameworks/sproutcore/frameworks/core_foundation/system/event.js +4 -4
  16. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/mixins/template_helpers/text_field_support.js +9 -0
  17. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/template/collection.js +110 -0
  18. data/lib/frameworks/sproutcore/frameworks/core_foundation/views/template_collection.js +63 -26
  19. data/lib/frameworks/sproutcore/frameworks/datastore/system/child_array.js +25 -5
  20. data/lib/frameworks/sproutcore/frameworks/datastore/system/record_array.js +3 -3
  21. data/lib/frameworks/sproutcore/frameworks/datastore/tests/models/nested_records/nested_record_array.js +26 -3
  22. data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/record_array/core_methods.js +74 -53
  23. data/lib/frameworks/sproutcore/frameworks/desktop/panes/alert.js +6 -7
  24. data/lib/frameworks/sproutcore/frameworks/desktop/panes/picker.js +6 -3
  25. data/lib/frameworks/sproutcore/frameworks/desktop/tests/panes/alert/ui.js +25 -1
  26. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/tab/methods.js +1 -3
  27. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/tab/ui.js +20 -1
  28. data/lib/frameworks/sproutcore/frameworks/desktop/views/select_field.js +1 -1
  29. data/lib/frameworks/sproutcore/frameworks/desktop/views/tab.js +46 -49
  30. data/lib/frameworks/sproutcore/frameworks/foundation/tests/views/container/ui.js +23 -0
  31. data/lib/frameworks/sproutcore/frameworks/foundation/views/container.js +14 -2
  32. data/lib/frameworks/sproutcore/frameworks/jquery/jquery-buffered.js +2 -76
  33. data/lib/frameworks/sproutcore/frameworks/jquery/jquery.js +3348 -1591
  34. data/lib/frameworks/sproutcore/frameworks/runtime/core.js +25 -5
  35. data/lib/frameworks/sproutcore/frameworks/runtime/system/index_set.js +0 -3
  36. data/lib/frameworks/sproutcore/frameworks/runtime/tests/core/objectForPropertyPath.js +10 -5
  37. data/lib/frameworks/sproutcore/frameworks/runtime/tests/core/requiredObjectForPropertyPath.js +29 -0
  38. data/lib/frameworks/sproutcore/frameworks/runtime/tests/private/observer_queue.js +98 -0
  39. data/lib/frameworks/sproutcore/themes/ace/resources/collection/normal/list_item.css +2 -2
  40. data/lib/frameworks/sproutcore/themes/ace/resources/split/split.css +1 -1
  41. data/lib/gen/language/Buildfile +1 -1
  42. data/lib/sproutcore.rb +1 -14
  43. data/lib/sproutcore/buildfile/string_ext.rb +0 -4
  44. data/lib/sproutcore/helpers/cssmin.rb +44 -59
  45. data/lib/sproutcore/helpers/text_helper.rb +11 -13
  46. data/lib/sproutcore/models/manifest.rb +4 -4
  47. data/lib/sproutcore/models/target.rb +11 -110
  48. data/lib/sproutcore/rack.rb +0 -1
  49. data/lib/sproutcore/rack/dev.rb +0 -1
  50. data/lib/sproutcore/rack/proxy.rb +9 -8
  51. data/lib/sproutcore/rack/service.rb +1 -1
  52. data/lib/sproutcore/render_engines/haml.rb +2 -5
  53. data/lib/sproutcore/tools/build.rb +2 -0
  54. data/lib/sproutcore/tools/docs.rb +7 -36
  55. data/lib/sproutcore/tools/manifest.rb +1 -1
  56. data/spec/buildtasks/target_spec.rb +9 -0
  57. data/spec/fixtures/real_world/frameworks/sproutcore/Buildfile +1 -1
  58. data/sproutcore.gemspec +3 -4
  59. data/vendor/chance/lib/chance/instance.rb +5 -8
  60. metadata +41 -207
  61. data/lib/doc_templates/jsdoc/allclasses.tmpl +0 -17
  62. data/lib/doc_templates/jsdoc/allfiles.tmpl +0 -56
  63. data/lib/doc_templates/jsdoc/class.tmpl +0 -487
  64. data/lib/doc_templates/jsdoc/index.tmpl +0 -38
  65. data/lib/doc_templates/jsdoc/publish.js +0 -170
  66. data/lib/doc_templates/jsdoc/static/default.css +0 -162
  67. data/lib/doc_templates/jsdoc/static/header.html +0 -2
  68. data/lib/doc_templates/jsdoc/static/index.html +0 -19
  69. data/lib/doc_templates/jsdoc/symbol.tmpl +0 -35
  70. data/lib/doc_templates/sproutcore/allclasses.tmpl +0 -0
  71. data/lib/doc_templates/sproutcore/allfiles.tmpl +0 -56
  72. data/lib/doc_templates/sproutcore/class.tmpl +0 -674
  73. data/lib/doc_templates/sproutcore/classes-json.tmpl +0 -55
  74. data/lib/doc_templates/sproutcore/index.tmpl +0 -62
  75. data/lib/doc_templates/sproutcore/publish.js +0 -346
  76. data/lib/doc_templates/sproutcore/static/default.css +0 -258
  77. data/lib/doc_templates/sproutcore/static/header.html +0 -2
  78. data/lib/doc_templates/sproutcore/static/index.html +0 -19
  79. data/lib/doc_templates/sproutcore/symbol.tmpl +0 -35
  80. data/lib/frameworks/sproutcore/frameworks/runtime/tests/private/observer_queue/isObservingSuspended.js +0 -55
  81. data/lib/sproutcore/rack/docs.rb +0 -24
  82. data/spec/fixtures/real_world/frameworks/sproutcore/apps/docs/PLACEHOLDER +0 -0
  83. data/vendor/jsdoc/README.txt +0 -151
  84. data/vendor/jsdoc/app/frame.js +0 -33
  85. data/vendor/jsdoc/app/frame/Chain.js +0 -102
  86. data/vendor/jsdoc/app/frame/Dumper.js +0 -144
  87. data/vendor/jsdoc/app/frame/Hash.js +0 -47
  88. data/vendor/jsdoc/app/frame/Link.js +0 -142
  89. data/vendor/jsdoc/app/frame/Namespace.js +0 -10
  90. data/vendor/jsdoc/app/frame/Opt.js +0 -134
  91. data/vendor/jsdoc/app/frame/Reflection.js +0 -26
  92. data/vendor/jsdoc/app/frame/String.js +0 -93
  93. data/vendor/jsdoc/app/frame/Testrun.js +0 -129
  94. data/vendor/jsdoc/app/handlers/FOODOC.js +0 -26
  95. data/vendor/jsdoc/app/handlers/XMLDOC.js +0 -26
  96. data/vendor/jsdoc/app/handlers/XMLDOC/DomReader.js +0 -159
  97. data/vendor/jsdoc/app/handlers/XMLDOC/XMLDoc.js +0 -16
  98. data/vendor/jsdoc/app/handlers/XMLDOC/XMLParse.js +0 -292
  99. data/vendor/jsdoc/app/lib/JSDOC.js +0 -98
  100. data/vendor/jsdoc/app/lib/JSDOC/DocComment.js +0 -200
  101. data/vendor/jsdoc/app/lib/JSDOC/DocTag.js +0 -294
  102. data/vendor/jsdoc/app/lib/JSDOC/JsDoc.js +0 -162
  103. data/vendor/jsdoc/app/lib/JSDOC/JsPlate.js +0 -100
  104. data/vendor/jsdoc/app/lib/JSDOC/Lang.js +0 -144
  105. data/vendor/jsdoc/app/lib/JSDOC/Parser.js +0 -109
  106. data/vendor/jsdoc/app/lib/JSDOC/PluginManager.js +0 -33
  107. data/vendor/jsdoc/app/lib/JSDOC/Symbol.js +0 -681
  108. data/vendor/jsdoc/app/lib/JSDOC/SymbolSet.js +0 -226
  109. data/vendor/jsdoc/app/lib/JSDOC/TextStream.js +0 -41
  110. data/vendor/jsdoc/app/lib/JSDOC/Token.js +0 -18
  111. data/vendor/jsdoc/app/lib/JSDOC/TokenReader.js +0 -332
  112. data/vendor/jsdoc/app/lib/JSDOC/TokenStream.js +0 -133
  113. data/vendor/jsdoc/app/lib/JSDOC/Util.js +0 -32
  114. data/vendor/jsdoc/app/lib/JSDOC/Walker.js +0 -453
  115. data/vendor/jsdoc/app/main.js +0 -74
  116. data/vendor/jsdoc/app/plugins/commentSrcJson.js +0 -19
  117. data/vendor/jsdoc/app/plugins/frameworkPrototype.js +0 -16
  118. data/vendor/jsdoc/app/plugins/functionCall.js +0 -10
  119. data/vendor/jsdoc/app/plugins/publishSrcHilite.js +0 -62
  120. data/vendor/jsdoc/app/plugins/sproutcoreTags.js +0 -26
  121. data/vendor/jsdoc/app/plugins/symbolLink.js +0 -9
  122. data/vendor/jsdoc/app/plugins/tagParamConfig.js +0 -31
  123. data/vendor/jsdoc/app/plugins/tagSynonyms.js +0 -43
  124. data/vendor/jsdoc/app/run.js +0 -346
  125. data/vendor/jsdoc/app/t/TestDoc.js +0 -144
  126. data/vendor/jsdoc/app/t/runner.js +0 -13
  127. data/vendor/jsdoc/app/test.js +0 -304
  128. data/vendor/jsdoc/app/test/addon.js +0 -24
  129. data/vendor/jsdoc/app/test/anon_inner.js +0 -14
  130. data/vendor/jsdoc/app/test/augments.js +0 -31
  131. data/vendor/jsdoc/app/test/augments2.js +0 -26
  132. data/vendor/jsdoc/app/test/borrows.js +0 -41
  133. data/vendor/jsdoc/app/test/borrows2.js +0 -23
  134. data/vendor/jsdoc/app/test/config.js +0 -22
  135. data/vendor/jsdoc/app/test/constructs.js +0 -18
  136. data/vendor/jsdoc/app/test/encoding.js +0 -10
  137. data/vendor/jsdoc/app/test/encoding_other.js +0 -12
  138. data/vendor/jsdoc/app/test/functions_anon.js +0 -39
  139. data/vendor/jsdoc/app/test/functions_nested.js +0 -33
  140. data/vendor/jsdoc/app/test/global.js +0 -13
  141. data/vendor/jsdoc/app/test/globals.js +0 -25
  142. data/vendor/jsdoc/app/test/ignore.js +0 -10
  143. data/vendor/jsdoc/app/test/inner.js +0 -16
  144. data/vendor/jsdoc/app/test/jsdoc_test.js +0 -477
  145. data/vendor/jsdoc/app/test/lend.js +0 -33
  146. data/vendor/jsdoc/app/test/memberof.js +0 -20
  147. data/vendor/jsdoc/app/test/memberof_constructor.js +0 -15
  148. data/vendor/jsdoc/app/test/name.js +0 -19
  149. data/vendor/jsdoc/app/test/namespace_nested.js +0 -23
  150. data/vendor/jsdoc/app/test/nocode.js +0 -13
  151. data/vendor/jsdoc/app/test/oblit_anon.js +0 -20
  152. data/vendor/jsdoc/app/test/overview.js +0 -20
  153. data/vendor/jsdoc/app/test/param_inline.js +0 -37
  154. data/vendor/jsdoc/app/test/params_optional.js +0 -8
  155. data/vendor/jsdoc/app/test/prototype.js +0 -17
  156. data/vendor/jsdoc/app/test/prototype_nested.js +0 -9
  157. data/vendor/jsdoc/app/test/prototype_oblit.js +0 -13
  158. data/vendor/jsdoc/app/test/prototype_oblit_constructor.js +0 -24
  159. data/vendor/jsdoc/app/test/public.js +0 -10
  160. data/vendor/jsdoc/app/test/shared.js +0 -42
  161. data/vendor/jsdoc/app/test/shared2.js +0 -2
  162. data/vendor/jsdoc/app/test/shortcuts.js +0 -22
  163. data/vendor/jsdoc/app/test/static_this.js +0 -13
  164. data/vendor/jsdoc/app/test/synonyms.js +0 -23
  165. data/vendor/jsdoc/app/test/tosource.js +0 -23
  166. data/vendor/jsdoc/app/test/variable_redefine.js +0 -14
  167. data/vendor/jsdoc/changes.txt +0 -47
  168. data/vendor/jsdoc/conf/sample.conf +0 -31
  169. data/vendor/jsdoc/java/build.xml +0 -36
  170. data/vendor/jsdoc/java/build_1.4.xml +0 -36
  171. data/vendor/jsdoc/java/classes/js.jar +0 -0
  172. data/vendor/jsdoc/java/src/JsDebugRun.java +0 -21
  173. data/vendor/jsdoc/java/src/JsRun.java +0 -21
  174. data/vendor/jsdoc/jsdebug.jar +0 -0
  175. data/vendor/jsdoc/jsrun.jar +0 -0
  176. data/vendor/jsdoc/t/TestDoc.js +0 -144
  177. data/vendor/jsdoc/t/runner.js +0 -13
  178. data/vendor/jsdoc/test.js +0 -304
  179. data/vendor/jsdoc/test/addon.js +0 -24
  180. data/vendor/jsdoc/test/anon_inner.js +0 -14
  181. data/vendor/jsdoc/test/augments.js +0 -31
  182. data/vendor/jsdoc/test/augments2.js +0 -26
  183. data/vendor/jsdoc/test/borrows.js +0 -41
  184. data/vendor/jsdoc/test/borrows2.js +0 -23
  185. data/vendor/jsdoc/test/config.js +0 -22
  186. data/vendor/jsdoc/test/constructs.js +0 -18
  187. data/vendor/jsdoc/test/encoding.js +0 -10
  188. data/vendor/jsdoc/test/encoding_other.js +0 -12
  189. data/vendor/jsdoc/test/functions_anon.js +0 -39
  190. data/vendor/jsdoc/test/functions_nested.js +0 -33
  191. data/vendor/jsdoc/test/global.js +0 -13
  192. data/vendor/jsdoc/test/globals.js +0 -25
  193. data/vendor/jsdoc/test/ignore.js +0 -10
  194. data/vendor/jsdoc/test/inner.js +0 -16
  195. data/vendor/jsdoc/test/jsdoc_test.js +0 -477
  196. data/vendor/jsdoc/test/lend.js +0 -33
  197. data/vendor/jsdoc/test/memberof.js +0 -20
  198. data/vendor/jsdoc/test/memberof_constructor.js +0 -15
  199. data/vendor/jsdoc/test/name.js +0 -19
  200. data/vendor/jsdoc/test/namespace_nested.js +0 -23
  201. data/vendor/jsdoc/test/nocode.js +0 -13
  202. data/vendor/jsdoc/test/oblit_anon.js +0 -20
  203. data/vendor/jsdoc/test/overview.js +0 -20
  204. data/vendor/jsdoc/test/param_inline.js +0 -37
  205. data/vendor/jsdoc/test/params_optional.js +0 -8
  206. data/vendor/jsdoc/test/prototype.js +0 -17
  207. data/vendor/jsdoc/test/prototype_nested.js +0 -9
  208. data/vendor/jsdoc/test/prototype_oblit.js +0 -13
  209. data/vendor/jsdoc/test/prototype_oblit_constructor.js +0 -24
  210. data/vendor/jsdoc/test/public.js +0 -10
  211. data/vendor/jsdoc/test/shared.js +0 -42
  212. data/vendor/jsdoc/test/shared2.js +0 -2
  213. data/vendor/jsdoc/test/shortcuts.js +0 -22
  214. data/vendor/jsdoc/test/static_this.js +0 -13
  215. data/vendor/jsdoc/test/synonyms.js +0 -23
  216. data/vendor/jsdoc/test/tosource.js +0 -23
  217. data/vendor/jsdoc/test/variable_redefine.js +0 -14
@@ -1,33 +0,0 @@
1
- /**
2
- @namespace Holds functionality related to running plugins.
3
- */
4
- JSDOC.PluginManager = {
5
- }
6
-
7
- /**
8
- @param name A unique name that identifies that plugin.
9
- @param handlers A collection of named functions. The names correspond to hooks in the core code.
10
- */
11
- JSDOC.PluginManager.registerPlugin = function(/**String*/name, /**Object*/handlers) {
12
- if (!defined(JSDOC.PluginManager.plugins))
13
- /** The collection of all plugins. Requires a unique name for each.
14
- */
15
- JSDOC.PluginManager.plugins = {};
16
-
17
-
18
- JSDOC.PluginManager.plugins[name] = handlers;
19
- }
20
-
21
- /**
22
- @param hook The name of the hook that is being caught.
23
- @param target Any object. This will be passed as the only argument to the handler whose
24
- name matches the hook name. Handlers cannot return a value, so must modify the target
25
- object to have an effect.
26
- */
27
- JSDOC.PluginManager.run = function(/**String*/hook, /**Mixed*/target) {
28
- for (var name in JSDOC.PluginManager.plugins) {
29
- if (defined(JSDOC.PluginManager.plugins[name][hook])) {
30
- JSDOC.PluginManager.plugins[name][hook](target);
31
- }
32
- }
33
- }
@@ -1,681 +0,0 @@
1
- if (typeof JSDOC == "undefined") JSDOC = {};
2
-
3
- /**
4
- Create a new Symbol.
5
- @class Represents a symbol in the source code.
6
- */
7
- JSDOC.Symbol = function() {
8
- this.init();
9
- if (arguments.length) this.populate.apply(this, arguments);
10
- }
11
-
12
- JSDOC.Symbol.prototype.init = function() {
13
- this.$args = [];
14
- this.addOn = "";
15
- this.alias = "";
16
- this.augments = [];
17
- this.author = "";
18
- this.classDesc = "";
19
- this.comment = {};
20
- this.defaultValue = undefined;
21
- this.deprecated = "";
22
- this.desc = "";
23
- this.events = [];
24
- this.example = [];
25
- this.exceptions = [];
26
- this.inherits = [];
27
- this.inheritsFrom = [];
28
- this.isa = "OBJECT";
29
- this.isEvent = false;
30
- this.isConstant = false;
31
- this.isIgnored = false;
32
- this.isInner = false;
33
- this.isNamespace = false;
34
- this.isPrivate = false;
35
- this.isStatic = false;
36
- this.memberOf = "";
37
- this.methods = [];
38
- this._name = "";
39
- this._params = [];
40
- this.properties = [];
41
- this.requires = [];
42
- this.returns = [];
43
- this.see = [];
44
- this.since = "";
45
- this.srcFile = {};
46
- this.type = "";
47
- this.version = "";
48
-
49
- /* START: Added by pbergstr on 01/15/2009 */
50
- this.copyright = "";
51
- this.observes = [];
52
- this.binding = [];
53
- this.isComputed = false;
54
- this.isReadOnly = false;
55
- this.commonTask = "";
56
- /* END: Added by pbergstr on 01/15/2009 */
57
-
58
-
59
- }
60
-
61
- JSDOC.Symbol.prototype.serialize = function() {
62
- var keys = [];
63
- for (var p in this) {
64
- keys.push (p);
65
- }
66
- keys = keys.sort();
67
-
68
- var out = "";
69
- for (var i in keys) {
70
- if (typeof this[keys[i]] == "function") continue;
71
- out += keys[i]+" => "+Dumper.dump(this[keys[i]])+",\n";
72
- }
73
- return "\n{\n" + out + "}\n";
74
- }
75
-
76
- JSDOC.Symbol.prototype.clone = function() {
77
- var clone = new JSDOC.Symbol();
78
- clone.populate.apply(clone, this.$args); // repopulate using the original arguments
79
- clone.srcFile = this.srcFile; // not the current srcFile, the one when the original was made
80
- return clone;
81
- }
82
-
83
- JSDOC.Symbol.prototype.__defineSetter__("name",
84
- function(n) { n = n.replace(/^_global_[.#-]/, ""); n = n.replace(/\.prototype\.?/g, '#'); this._name = n; }
85
- );
86
- JSDOC.Symbol.prototype.__defineGetter__("name",
87
- function() { return this._name; }
88
- );
89
- JSDOC.Symbol.prototype.__defineSetter__("params",
90
- function(v) {
91
- for (var i = 0, l = v.length; i < l; i++) {
92
- if (v[i].constructor != JSDOC.DocTag) { // may be a generic object parsed from signature, like {type:..., name:...}
93
- this._params[i] = new JSDOC.DocTag("param"+((v[i].type)?" {"+v[i].type+"}":"")+" "+v[i].name);
94
- }
95
- else {
96
- this._params[i] = v[i];
97
- }
98
- }
99
- }
100
- );
101
- JSDOC.Symbol.prototype.__defineGetter__("params",
102
- function() { return this._params; }
103
- );
104
-
105
- JSDOC.Symbol.prototype.populate = function(
106
- /** String */ name,
107
- /** Object[] */ params,
108
- /** String */ isa,
109
- /** JSDOC.DocComment */ comment
110
- ) {
111
- this.$args = arguments;
112
-
113
- this.name = name;
114
- this.alias = this.name;
115
- this.params = params;
116
- this.isa = (isa == "VIRTUAL")? "OBJECT":isa;
117
- this.comment = comment || new JSDOC.DocComment("");
118
- this.srcFile = JSDOC.Symbol.srcFile;
119
-
120
- if (this.is("FILE") && !this.alias) this.alias = this.srcFile;
121
-
122
- this.setTags();
123
-
124
- if (typeof JSDOC.PluginManager != "undefined") {
125
- JSDOC.PluginManager.run("onSymbol", this);
126
- }
127
- }
128
-
129
- JSDOC.Symbol.prototype.setTags = function() {
130
- // @author
131
- var authors = this.comment.getTag("author");
132
- if (authors.length) {
133
- this.author = authors.map(function($){return $.desc;}).join(", ");
134
- }
135
-
136
- /*t:
137
- plan(34, "testing JSDOC.Symbol");
138
-
139
- requires("../lib/JSDOC/DocComment.js");
140
- requires("../frame/String.js");
141
- requires("../lib/JSDOC/DocTag.js");
142
-
143
- var sym = new JSDOC.Symbol("foo", [], "OBJECT", new JSDOC.DocComment("/**@author Joe Smith*"+"/"));
144
- is(sym.author, "Joe Smith", "@author tag, author is found.");
145
- */
146
-
147
- // @desc
148
- var descs = this.comment.getTag("desc");
149
- if (descs.length) {
150
- this.desc = descs.map(function($){return $.desc;}).join("\n"); // multiple descriptions are concatenated into one
151
- }
152
-
153
- /* START: Added by pbergstr on 01/29/2009 */
154
-
155
- var commonTask = this.comment.getTag("commonTask");
156
- if (commonTask.length) {
157
- this.commonTask = commonTask[0].desc;
158
- }
159
-
160
- var obs = this.comment.getTag("observes");
161
- if (obs.length) {
162
- this.observes = obs.map(function($){return $.desc});
163
- }
164
-
165
- var bind = this.comment.getTag("binding");
166
- if (bind.length) {
167
- this.binding = bind.map(function($){return $.desc});
168
- }
169
-
170
-
171
- var isComputed = this.comment.getTag("isComputed");
172
- if(isComputed.length)
173
- {
174
- this.isComputed = true;
175
- }
176
-
177
- var isReadOnly = this.comment.getTag("isReadOnly");
178
- if(isReadOnly.length)
179
- {
180
- this.isReadOnly = true;
181
- }
182
-
183
- var rights = this.comment.getTag("copyright");
184
- if (rights.length) {
185
- this.copyright = rights.map(function($){return $.desc});
186
- }
187
-
188
-
189
- /* END: Added by pbergstr on 01/29/2009 */
190
-
191
-
192
-
193
-
194
-
195
-
196
- /*t:
197
- var sym = new JSDOC.Symbol("foo", [], "OBJECT", new JSDOC.DocComment("/**@desc This is a description.*"+"/"));
198
- is(sym.desc, "This is a description.", "@desc tag, description is found.");
199
- */
200
-
201
- // @overview
202
- if (this.is("FILE")) {
203
- if (!this.alias) this.alias = this.srcFile;
204
-
205
- var overviews = this.comment.getTag("overview");
206
- if (overviews.length) {
207
- this.desc = [this.desc].concat(overviews.map(function($){return $.desc;})).join("\n");
208
- }
209
- }
210
-
211
- /*t:
212
- var sym = new JSDOC.Symbol("foo", [], "FILE", new JSDOC.DocComment("/**@overview This is an overview.*"+"/"));
213
- is(sym.desc, "\nThis is an overview.", "@overview tag, description is found.");
214
- */
215
-
216
- // @since
217
- var sinces = this.comment.getTag("since");
218
- if (sinces.length) {
219
- this.since = sinces.map(function($){return $.desc;}).join(", ");
220
- }
221
-
222
- /*t:
223
- var sym = new JSDOC.Symbol("foo", [], "FILE", new JSDOC.DocComment("/**@since 1.01*"+"/"));
224
- is(sym.since, "1.01", "@since tag, description is found.");
225
- */
226
-
227
- // @constant
228
- if (this.comment.getTag("constant").length) {
229
- this.isConstant = true;
230
- }
231
-
232
- /*t:
233
- var sym = new JSDOC.Symbol("foo", [], "FILE", new JSDOC.DocComment("/**@constant*"+"/"));
234
- is(sym.isConstant, true, "@constant tag, isConstant set.");
235
- */
236
-
237
- // @version
238
- var versions = this.comment.getTag("version");
239
- if (versions.length) {
240
- this.version = versions.map(function($){return $.desc;}).join(", ");
241
- }
242
-
243
- /*t:
244
- var sym = new JSDOC.Symbol("foo", [], "FILE", new JSDOC.DocComment("/**@version 2.0x*"+"/"));
245
- is(sym.version, "2.0x", "@version tag, version is found.");
246
- */
247
-
248
- // @deprecated
249
- var deprecateds = this.comment.getTag("deprecated");
250
- if (deprecateds.length) {
251
- this.deprecated = deprecateds.map(function($){return $.desc;}).join("\n");
252
- }
253
-
254
- /*t:
255
- var sym = new JSDOC.Symbol("foo", [], "FILE", new JSDOC.DocComment("/**@deprecated Use other method.*"+"/"));
256
- is(sym.deprecated, "Use other method.", "@deprecated tag, desc is found.");
257
- */
258
-
259
- // @example
260
- var examples = this.comment.getTag("example");
261
- if (examples.length) {
262
- this.example = examples.map(
263
- // trim trailing whitespace
264
- function($) {
265
- $.desc = $.desc.replace(/\s+$/, "");
266
- return $;
267
- }
268
- );
269
- }
270
-
271
- /*t:
272
- var sym = new JSDOC.Symbol("foo", [], "FILE", new JSDOC.DocComment("/**@example This\n is an example. \n*"+"/"));
273
- isnt(typeof sym.example[0], "undefined", "@example tag, creates sym.example array.");
274
- is(sym.example[0], "This\n is an example.", "@example tag, desc is found.");
275
- */
276
-
277
- // @see
278
- var sees = this.comment.getTag("see");
279
- if (sees.length) {
280
- var thisSee = this.see;
281
- sees.map(function($){thisSee.push($.desc);});
282
- }
283
-
284
- /*t:
285
- var sym = new JSDOC.Symbol("foo", [], "FILE", new JSDOC.DocComment("/**@see The other thing.*"+"/"));
286
- is(sym.see, "The other thing.", "@see tag, desc is found.");
287
- */
288
-
289
- // @class
290
- var classes = this.comment.getTag("class");
291
- if (classes.length) {
292
- this.isa = "CONSTRUCTOR";
293
- this.classDesc = classes[0].desc; // desc can't apply to the constructor as there is none.
294
- }
295
-
296
- /*t:
297
- var sym = new JSDOC.Symbol("foo", [], "OBJECT", new JSDOC.DocComment("/**@class This describes the class.*"+"/"));
298
- is(sym.isa, "CONSTRUCTOR", "@class tag, makes symbol a constructor.");
299
- is(sym.classDesc, "This describes the class.", "@class tag, class description is found.");
300
- */
301
-
302
- // @namespace
303
- var namespaces = this.comment.getTag("namespace");
304
- if (namespaces.length) {
305
- this.classDesc = namespaces[0].desc+"\n"+this.desc; // desc can't apply to the constructor as there is none.
306
- this.isNamespace = true;
307
- }
308
-
309
- /*t:
310
- var sym = new JSDOC.Symbol("foo", [], "OBJECT", new JSDOC.DocComment("/**@namespace This describes the namespace.*"+"/"));
311
- is(sym.classDesc, "This describes the namespace.\n", "@namespace tag, class description is found.");
312
- */
313
-
314
- // @param
315
- var params = this.comment.getTag("param");
316
- if (params.length) {
317
- // user-defined params overwrite those with same name defined by the parser
318
- var thisParams = this.params;
319
-
320
- if (thisParams.length == 0) { // none exist yet, so just bung all these user-defined params straight in
321
- this.params = params;
322
- }
323
- else { // need to overlay these user-defined params on to existing parser-defined params
324
- for (var i = 0, l = params.length; i < l; i++) {
325
- if (thisParams[i]) {
326
- if (params[i].type) thisParams[i].type = params[i].type;
327
- thisParams[i].name = params[i].name;
328
- thisParams[i].desc = params[i].desc;
329
- thisParams[i].isOptional = params[i].isOptional;
330
- thisParams[i].defaultValue = params[i].defaultValue;
331
- }
332
- else thisParams[i] = params[i];
333
- }
334
- }
335
- }
336
-
337
- /*t:
338
- var sym = new JSDOC.Symbol("foo", [{type: "array", name: "pages"}], "FUNCTION", new JSDOC.DocComment("/**Description.*"+"/"));
339
- is(sym.params.length, 1, "parser defined param is found.");
340
-
341
- sym = new JSDOC.Symbol("foo", [], "FUNCTION", new JSDOC.DocComment("/**Description.\n@param {array} pages*"+"/"));
342
- is(sym.params.length, 1, "user defined param is found.");
343
- is(sym.params[0].type, "array", "user defined param type is found.");
344
- is(sym.params[0].name, "pages", "user defined param name is found.");
345
-
346
- sym = new JSDOC.Symbol("foo", [{type: "array", name: "pages"}], "FUNCTION", new JSDOC.DocComment("/**Description.\n@param {string} uid*"+"/"));
347
- is(sym.params.length, 1, "user defined param overwrites parser defined param.");
348
- is(sym.params[0].type, "string", "user defined param type overwrites parser defined param type.");
349
- is(sym.params[0].name, "uid", "user defined param name overwrites parser defined param name.");
350
-
351
- sym = new JSDOC.Symbol("foo", [{type: "array", name: "pages"}, {type: "number", name: "count"}], "FUNCTION", new JSDOC.DocComment("/**Description.\n@param {string} uid*"+"/"));
352
- is(sym.params.length, 2, "user defined params overlay parser defined params.");
353
- is(sym.params[1].type, "number", "user defined param type overlays parser defined param type.");
354
- is(sym.params[1].name, "count", "user defined param name overlays parser defined param name.");
355
-
356
- sym = new JSDOC.Symbol("foo", [], "FUNCTION", new JSDOC.DocComment("/**Description.\n@param {array} pages The pages description.*"+"/"));
357
- is(sym.params.length, 1, "user defined param with description is found.");
358
- is(sym.params[0].desc, "The pages description.", "user defined param description is found.");
359
- */
360
-
361
- // @constructor
362
- if (this.comment.getTag("constructor").length) {
363
- this.isa = "CONSTRUCTOR";
364
- }
365
-
366
- /*t:
367
- var sym = new JSDOC.Symbol("foo", [], "OBJECT", new JSDOC.DocComment("/**@constructor*"+"/"));
368
- is(sym.isa, "CONSTRUCTOR", "@constructor tag, makes symbol a constructor.");
369
- */
370
-
371
- // @static
372
- if (this.comment.getTag("static").length) {
373
- this.isStatic = true;
374
- if (this.isa == "CONSTRUCTOR") {
375
- this.isNamespace = true;
376
- }
377
- }
378
-
379
- /*t:
380
- var sym = new JSDOC.Symbol("foo", [], "OBJECT", new JSDOC.DocComment("/**@static\n@constructor*"+"/"));
381
- is(sym.isStatic, true, "@static tag, makes isStatic true.");
382
- is(sym.isNamespace, true, "@static and @constructor tag, makes isNamespace true.");
383
- */
384
-
385
- // @inner
386
- if (this.comment.getTag("inner").length) {
387
- this.isInner = true;
388
- this.isStatic = false;
389
- }
390
-
391
- /*t:
392
- var sym = new JSDOC.Symbol("foo", [], "OBJECT", new JSDOC.DocComment("/**@inner*"+"/"));
393
- is(sym.isStatic, false, "@inner tag, makes isStatic false.");
394
- is(sym.isInner, true, "@inner makes isInner true.");
395
- */
396
-
397
- // @field
398
- var field = this.comment.getTag("field");
399
- if (field.length)
400
- {
401
- this.isa = "OBJECT";
402
- this.type = field[0].type;
403
- }
404
-
405
-
406
- // var binding = this.comment.getTag("binding");
407
- // if (binding.length)
408
- // {
409
- // this.isa = "OBJECT";
410
- // this.type = binding[0].type;
411
- //
412
- // // for(var key in this)
413
- // // {
414
- // // LOG.warn(key);
415
- // // LOG.warn(this[key])
416
- // // }
417
- //
418
- // for(var i=0; i<this.$args.length; i++)
419
- // {
420
- // LOG.warn(this.$args[i])
421
- //
422
- // }
423
- //
424
- // this.binding[0] = '';
425
- //
426
- //
427
- // }
428
- /*t:
429
- var sym = new JSDOC.Symbol("foo", [], "FUNCTION", new JSDOC.DocComment("/**@field*"+"/"));
430
- is(sym.isa, "OBJECT", "@field tag, makes symbol an object.");
431
- */
432
-
433
- // @function
434
- if (this.comment.getTag("function").length) {
435
- this.isa = "FUNCTION";
436
- }
437
-
438
- /*t:
439
- var sym = new JSDOC.Symbol("foo", [], "OBJECT", new JSDOC.DocComment("/**@function*"+"/"));
440
- is(sym.isa, "FUNCTION", "@function tag, makes symbol a function.");
441
- */
442
-
443
- // @event
444
- var events = this.comment.getTag("event");
445
- if (events.length) {
446
- this.isa = "FUNCTION";
447
- this.isEvent = true;
448
- }
449
-
450
- /*t:
451
- var sym = new JSDOC.Symbol("foo", [], "OBJECT", new JSDOC.DocComment("/**@event*"+"/"));
452
- is(sym.isa, "FUNCTION", "@event tag, makes symbol a function.");
453
- is(sym.isEvent, true, "@event makes isEvent true.");
454
- */
455
-
456
- // @name
457
- var names = this.comment.getTag("name");
458
- if (names.length) {
459
- this.name = names[0].desc;
460
- }
461
-
462
- /*t:
463
- // todo
464
- */
465
- // @property
466
- var properties = this.comment.getTag("property");
467
- if (properties.length) {
468
- thisProperties = this.properties;
469
- for (var i = 0; i < properties.length; i++) {
470
- var property = new JSDOC.Symbol(this.alias+"#"+properties[i].name, [], "OBJECT", new JSDOC.DocComment("/**"+properties[i].desc+"\n@name "+properties[i].name+"\n@memberOf "+this.alias+"#*/"));
471
-
472
-
473
- // TODO: shouldn't the following happen in the addProperty method of Symbol?
474
- property.name = properties[i].name;
475
- property.memberOf = this.alias;
476
- if (properties[i].type) property.type = properties[i].type;
477
- if (properties[i].defaultValue) property.defaultValue = properties[i].defaultValue;
478
- this.addProperty(property);
479
- JSDOC.Parser.addSymbol(property);
480
- }
481
- }
482
-
483
- /*t:
484
- // todo
485
- */
486
-
487
- // @return
488
- var returns = this.comment.getTag("return");
489
- if (returns.length) { // there can be many return tags in a single doclet
490
- this.returns = returns;
491
- this.type = returns.map(function($){return $.type}).join(", ");
492
- }
493
-
494
- /*t:
495
- // todo
496
- */
497
-
498
- // @exception
499
- this.exceptions = this.comment.getTag("throws");
500
-
501
- /*t:
502
- // todo
503
- */
504
-
505
- // @requires
506
- var requires = this.comment.getTag("requires");
507
- if (requires.length) {
508
- this.requires = requires.map(function($){return $.desc});
509
- }
510
-
511
- /*t:
512
- // todo
513
- */
514
-
515
- // @type
516
- var types = this.comment.getTag("type");
517
- if (types.length) {
518
- this.type = types[0].desc; //multiple type tags are ignored
519
- }
520
-
521
- /*t:
522
- // todo
523
- */
524
-
525
- // @private
526
- if (this.comment.getTag("private").length || this.isInner) {
527
- this.isPrivate = true;
528
- }
529
-
530
- // @ignore
531
- if (this.comment.getTag("ignore").length) {
532
- this.isIgnored = true;
533
- }
534
-
535
- /*t:
536
- // todo
537
- */
538
-
539
- // @inherits ... as ...
540
- var inherits = this.comment.getTag("inherits");
541
- if (inherits.length) {
542
- for (var i = 0; i < inherits.length; i++) {
543
- if (/^\s*([a-z$0-9_.#-]+)(?:\s+as\s+([a-z$0-9_.#]+))?/i.test(inherits[i].desc)) {
544
- var inAlias = RegExp.$1;
545
- var inAs = RegExp.$2 || inAlias;
546
-
547
- if (inAlias) inAlias = inAlias.replace(/\.prototype\.?/g, "#");
548
-
549
- if (inAs) {
550
- inAs = inAs.replace(/\.prototype\.?/g, "#");
551
- inAs = inAs.replace(/^this\.?/, "#");
552
- }
553
-
554
- if (inAs.indexOf(inAlias) != 0) { //not a full namepath
555
- var joiner = ".";
556
- if (this.alias.charAt(this.alias.length-1) == "#" || inAs.charAt(0) == "#") {
557
- joiner = "";
558
- }
559
- inAs = this.alias + joiner + inAs;
560
- }
561
- }
562
- this.inherits.push({alias: inAlias, as: inAs});
563
- }
564
- }
565
-
566
- /*t:
567
- // todo
568
- */
569
-
570
- // @augments
571
- this.augments = this.comment.getTag("augments");
572
-
573
- // @default
574
- var defaults = this.comment.getTag("default");
575
- if (defaults.length) {
576
- if (this.is("OBJECT")) {
577
- this.defaultValue = defaults[0].desc;
578
- }
579
- }
580
-
581
- /*t:
582
- // todo
583
- */
584
-
585
- // @memberOf
586
- var memberOfs = this.comment.getTag("memberOf");
587
- if (memberOfs.length) {
588
- this.memberOf = memberOfs[0].desc;
589
- this.memberOf = this.memberOf.replace(/\.prototype\.?/g, "#");
590
- }
591
-
592
- /*t:
593
- // todo
594
- */
595
-
596
- // @public
597
- if (this.comment.getTag("public").length) {
598
- this.isPrivate = false;
599
- }
600
-
601
- /*t:
602
- // todo
603
- */
604
- }
605
-
606
- JSDOC.Symbol.prototype.is = function(what) {
607
- return this.isa === what;
608
- }
609
-
610
- JSDOC.Symbol.prototype.isBuiltin = function() {
611
- return JSDOC.Lang.isBuiltin(this.alias);
612
- }
613
-
614
- JSDOC.Symbol.prototype.setType = function(/**String*/comment, /**Boolean*/overwrite) {
615
- if (!overwrite && this.type) return;
616
- var typeComment = JSDOC.DocComment.unwrapComment(comment);
617
- this.type = typeComment;
618
- }
619
-
620
- JSDOC.Symbol.prototype.inherit = function(symbol) {
621
- if (!this.hasMember(symbol.name) && !symbol.isInner) {
622
- if (symbol.is("FUNCTION"))
623
- this.methods.push(symbol);
624
- else if (symbol.is("OBJECT"))
625
- this.properties.push(symbol);
626
- }
627
- }
628
-
629
- JSDOC.Symbol.prototype.hasMember = function(name) {
630
- return (this.hasMethod(name) || this.hasProperty(name));
631
- }
632
-
633
- JSDOC.Symbol.prototype.addMember = function(symbol) {
634
- if (symbol.is("FUNCTION")) { this.addMethod(symbol); }
635
- else if (symbol.is("OBJECT")) { this.addProperty(symbol); }
636
- }
637
-
638
- JSDOC.Symbol.prototype.hasMethod = function(name) {
639
- var thisMethods = this.methods;
640
- for (var i = 0, l = thisMethods.length; i < l; i++) {
641
- if (thisMethods[i].name == name) return true;
642
- if (thisMethods[i].alias == name) return true;
643
- }
644
- return false;
645
- }
646
-
647
- JSDOC.Symbol.prototype.addMethod = function(symbol) {
648
- var methodAlias = symbol.alias;
649
- var thisMethods = this.methods;
650
- for (var i = 0, l = thisMethods.length; i < l; i++) {
651
- if (thisMethods[i].alias == methodAlias) {
652
- thisMethods[i] = symbol; // overwriting previous method
653
- return;
654
- }
655
- }
656
- thisMethods.push(symbol); // new method with this alias
657
- }
658
-
659
- JSDOC.Symbol.prototype.hasProperty = function(name) {
660
- var thisProperties = this.properties;
661
- for (var i = 0, l = thisProperties.length; i < l; i++) {
662
- if (thisProperties[i].name == name) return true;
663
- if (thisProperties[i].alias == name) return true;
664
- }
665
- return false;
666
- }
667
-
668
- JSDOC.Symbol.prototype.addProperty = function(symbol) {
669
- var propertyAlias = symbol.alias;
670
- var thisProperties = this.properties;
671
- for (var i = 0, l = thisProperties.length; i < l; i++) {
672
- if (thisProperties[i].alias == propertyAlias) {
673
- thisProperties[i] = symbol; // overwriting previous property
674
- return;
675
- }
676
- }
677
-
678
- thisProperties.push(symbol); // new property with this alias
679
- }
680
-
681
- JSDOC.Symbol.srcFile = ""; //running reference to the current file being parsed