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,133 +0,0 @@
1
- if (typeof JSDOC == "undefined") JSDOC = {};
2
-
3
- /**
4
- @constructor
5
- */
6
- JSDOC.TokenStream = function(tokens) {
7
- this.tokens = (tokens || []);
8
- this.rewind();
9
- }
10
-
11
- /**
12
- @constructor
13
- @private
14
- */
15
- function VoidToken(/**String*/type) {
16
- this.toString = function() {return "<VOID type=\""+type+"\">"};
17
- this.is = function(){return false;}
18
- }
19
-
20
- JSDOC.TokenStream.prototype.rewind = function() {
21
- this.cursor = -1;
22
- }
23
-
24
- /**
25
- @type JSDOC.Token
26
- */
27
- JSDOC.TokenStream.prototype.look = function(/**Number*/n, /**Boolean*/considerWhitespace) {
28
- if (typeof n == "undefined") n = 0;
29
-
30
- if (considerWhitespace == true) {
31
- if (this.cursor+n < 0 || this.cursor+n > this.tokens.length) return {};
32
- return this.tokens[this.cursor+n];
33
- }
34
- else {
35
- var count = 0;
36
- var i = this.cursor;
37
-
38
- while (true) {
39
- if (i < 0) return new JSDOC.Token("", "VOID", "START_OF_STREAM");
40
- else if (i > this.tokens.length) return new JSDOC.Token("", "VOID", "END_OF_STREAM");
41
-
42
- if (i != this.cursor && (this.tokens[i] === undefined || this.tokens[i].is("WHIT"))) {
43
- if (n < 0) i--; else i++;
44
- continue;
45
- }
46
-
47
- if (count == Math.abs(n)) {
48
- return this.tokens[i];
49
- }
50
- count++;
51
- (n < 0)? i-- : i++;
52
- }
53
-
54
- return new JSDOC.Token("", "VOID", "STREAM_ERROR"); // because null isn't an object and caller always expects an object
55
- }
56
- }
57
-
58
- /**
59
- @type JSDOC.Token|JSDOC.Token[]
60
- */
61
- JSDOC.TokenStream.prototype.next = function(/**Number*/howMany) {
62
- if (typeof howMany == "undefined") howMany = 1;
63
- if (howMany < 1) return null;
64
- var got = [];
65
-
66
- for (var i = 1; i <= howMany; i++) {
67
- if (this.cursor+i >= this.tokens.length) {
68
- return null;
69
- }
70
- got.push(this.tokens[this.cursor+i]);
71
- }
72
- this.cursor += howMany;
73
-
74
- if (howMany == 1) {
75
- return got[0];
76
- }
77
- else return got;
78
- }
79
-
80
- /**
81
- @type JSDOC.Token[]
82
- */
83
- JSDOC.TokenStream.prototype.balance = function(/**String*/start, /**String*/stop) {
84
- if (!stop) stop = JSDOC.Lang.matching(start);
85
-
86
- var depth = 0;
87
- var got = [];
88
- var started = false;
89
-
90
- while ((token = this.look())) {
91
- if (token.is(start)) {
92
- depth++;
93
- started = true;
94
- }
95
-
96
- if (started) {
97
- got.push(token);
98
- }
99
-
100
- if (token.is(stop)) {
101
- depth--;
102
- if (depth == 0) return got;
103
- }
104
- if (!this.next()) break;
105
- }
106
- }
107
-
108
- JSDOC.TokenStream.prototype.getMatchingToken = function(/**String*/start, /**String*/stop) {
109
- var depth = 0;
110
- var cursor = this.cursor;
111
-
112
- if (!start) {
113
- start = JSDOC.Lang.matching(stop);
114
- depth = 1;
115
- }
116
- if (!stop) stop = JSDOC.Lang.matching(start);
117
-
118
- while ((token = this.tokens[cursor])) {
119
- if (token.is(start)) {
120
- depth++;
121
- }
122
-
123
- if (token.is(stop) && cursor) {
124
- depth--;
125
- if (depth == 0) return {index: cursor, matching: this.tokens[cursor]};
126
- }
127
- cursor++;
128
- }
129
- }
130
-
131
- JSDOC.TokenStream.prototype.insertAhead = function(/**JSDOC.Token*/token) {
132
- this.tokens.splice(this.cursor+1, 0, token);
133
- }
@@ -1,32 +0,0 @@
1
- /**
2
- * @namespace
3
- * @deprecated Use {@link FilePath} instead.
4
- */
5
- JSDOC.Util = {
6
- }
7
-
8
- /**
9
- * @deprecated Use {@link FilePath.fileName} instead.
10
- */
11
- JSDOC.Util.fileName = function(path) {
12
- LOG.warn("JSDOC.Util.fileName is deprecated. Use FilePath.fileName instead.");
13
- var nameStart = Math.max(path.lastIndexOf("/")+1, path.lastIndexOf("\\")+1, 0);
14
- return path.substring(nameStart);
15
- }
16
-
17
- /**
18
- * @deprecated Use {@link FilePath.fileExtension} instead.
19
- */
20
- JSDOC.Util.fileExtension = function(filename) {
21
- LOG.warn("JSDOC.Util.fileExtension is deprecated. Use FilePath.fileExtension instead.");
22
- return filename.split(".").pop().toLowerCase();
23
- };
24
-
25
- /**
26
- * @deprecated Use {@link FilePath.dir} instead.
27
- */
28
- JSDOC.Util.dir = function(path) {
29
- LOG.warn("JSDOC.Util.dir is deprecated. Use FilePath.dir instead.");
30
- var nameStart = Math.max(path.lastIndexOf("/")+1, path.lastIndexOf("\\")+1, 0);
31
- return path.substring(0, nameStart-1);
32
- }
@@ -1,453 +0,0 @@
1
- if (typeof JSDOC == "undefined") JSDOC = {};
2
-
3
- /** @constructor */
4
- JSDOC.Walker = function(/**JSDOC.TokenStream*/ts) {
5
- this.init();
6
- if (typeof ts != "undefined") {
7
- this.walk(ts);
8
- }
9
- }
10
-
11
- JSDOC.Walker.prototype.init = function() {
12
- this.ts = null;
13
-
14
- var globalSymbol = new JSDOC.Symbol("_global_", [], "GLOBAL", new JSDOC.DocComment(""), {});
15
- globalSymbol.isNamespace = true;
16
- globalSymbol.srcFile = "";
17
- globalSymbol.isPrivate = false;
18
- JSDOC.Parser.addSymbol(globalSymbol);
19
- this.lastDoc = null;
20
- this.token = null;
21
-
22
- /**
23
- The chain of symbols under which we are currently nested.
24
- @type Array
25
- */
26
- this.namescope = [globalSymbol];
27
- this.namescope.last = function(n){ if (!n) n = 0; return this[this.length-(1+n)] || "" };
28
- }
29
-
30
- JSDOC.Walker.prototype.walk = function(/**JSDOC.TokenStream*/ts) {
31
- this.ts = ts;
32
- while (this.token = this.ts.look()) {
33
- if (this.token.popNamescope) {
34
-
35
- var symbol = this.namescope.pop();
36
- if (symbol.is("FUNCTION")) {
37
- if (this.ts.look(1).is("LEFT_PAREN") && symbol.comment.getTag("function").length == 0) {
38
- symbol.isa = "OBJECT";
39
- }
40
- }
41
- }
42
- this.step();
43
- if (!this.ts.next()) break;
44
- }
45
- }
46
-
47
- JSDOC.Walker.prototype.step = function() {
48
- var opts = {isBinding: false, isObserver: false, bindingPath: '', observedProperties: []};
49
- if (this.token.is("JSDOC")) { // it's a doc comment
50
-
51
- var doc = new JSDOC.DocComment(this.token.data);
52
-
53
- if (doc.getTag("lends").length > 0) { // it's a new namescope
54
- var lends = doc.getTag("lends")[0];
55
-
56
- var name = lends.desc
57
- if (!name) throw "@lends tag requires a value.";
58
-
59
- var symbol = new JSDOC.Symbol(name, [], "OBJECT", doc, opts);
60
-
61
- this.namescope.push(symbol);
62
-
63
- var matching = this.ts.getMatchingToken("LEFT_CURLY");
64
- if (matching) matching.matching.popNamescope = name;
65
- else LOG.warn("Mismatched } character. Can't parse code.");
66
-
67
- this.lastDoc = null;
68
- return true;
69
- }
70
- else if (doc.getTag("name").length > 0 && doc.getTag("overview").length == 0) { // it's a virtual symbol
71
- var virtualName = doc.getTag("name")[0].desc;
72
- if (!virtualName) throw "@name tag requires a value.";
73
-
74
- var symbol = new JSDOC.Symbol(virtualName, [], "VIRTUAL", doc, opts);
75
-
76
- JSDOC.Parser.addSymbol(symbol);
77
-
78
- this.lastDoc = null;
79
- return true;
80
- }
81
- else if (doc.meta) { // it's a meta doclet
82
- if (doc.meta == "@+") JSDOC.DocComment.shared = doc.src;
83
- else if (doc.meta == "@-") JSDOC.DocComment.shared = "";
84
- else if (doc.meta == "nocode+") JSDOC.Parser.conf.ignoreCode = true;
85
- else if (doc.meta == "nocode-") JSDOC.Parser.conf.ignoreCode = JSDOC.opt.n;
86
- else throw "Unrecognized meta comment: "+doc.meta;
87
-
88
- this.lastDoc = null;
89
- return true;
90
- }
91
- else if (doc.getTag("overview").length > 0) { // it's a file overview
92
- symbol = new JSDOC.Symbol("", [], "FILE", doc, opts);
93
-
94
- JSDOC.Parser.addSymbol(symbol);
95
-
96
- this.lastDoc = null;
97
- return true;
98
- }
99
- else {
100
- this.lastDoc = doc;
101
- return false;
102
- }
103
- }
104
- else if (!JSDOC.Parser.conf.ignoreCode) { // it's code
105
- if (this.token.is("NAME")) {
106
- var symbol;
107
- var name = this.token.data;
108
- var doc = null; if (this.lastDoc) doc = this.lastDoc;
109
- var params = [];
110
-
111
- // it's inside an anonymous object
112
- if (this.ts.look(1).is("COLON") && this.ts.look(-1).is("LEFT_CURLY") && !(this.ts.look(-2).is("JSDOC") || this.namescope.last().comment.getTag("lends").length || this.ts.look(-2).is("ASSIGN") || this.ts.look(-2).is("COLON"))) {
113
- name = "$anonymous";
114
- name = this.namescope.last().alias+"-"+name
115
-
116
- params = [];
117
-
118
- symbol = new JSDOC.Symbol(name, params, "OBJECT", doc, opts);
119
-
120
- JSDOC.Parser.addSymbol(symbol);
121
-
122
- this.namescope.push(symbol);
123
-
124
- var matching = this.ts.getMatchingToken(null, "RIGHT_CURLY");
125
- if (matching) matching.matching.popNamescope = name;
126
- else LOG.warn("Mismatched } character. Can't parse code.");
127
- }
128
- // function foo() {}
129
- else if (this.ts.look(-1).is("FUNCTION") && this.ts.look(1).is("LEFT_PAREN")) {
130
- var isInner;
131
-
132
- if (this.lastDoc) doc = this.lastDoc;
133
- name = this.namescope.last().alias+"-"+name;
134
- if (!this.namescope.last().is("GLOBAL")) isInner = true;
135
-
136
- params = JSDOC.Walker.onParamList(this.ts.balance("LEFT_PAREN"));
137
-
138
- symbol = new JSDOC.Symbol(name, params, "FUNCTION", doc, opts);
139
- if (isInner) symbol.isInner = true;
140
-
141
-
142
- JSDOC.Parser.addSymbol(symbol);
143
-
144
- this.namescope.push(symbol);
145
-
146
- var matching = this.ts.getMatchingToken("LEFT_CURLY");
147
- if (matching) matching.matching.popNamescope = name;
148
- else LOG.warn("Mismatched } character. Can't parse code.");
149
- }
150
- // foo = function() {}
151
- else if (this.ts.look(1).is("ASSIGN") && this.ts.look(2).is("FUNCTION")) {
152
- var isInner;
153
- if (this.ts.look(-1).is("VAR") || this.isInner) {
154
- name = this.namescope.last().alias+"-"+name
155
- if (!this.namescope.last().is("GLOBAL")) isInner = true;
156
- }
157
- else if (name.indexOf("this.") == 0) {
158
- name = this.resolveThis(name);
159
- }
160
-
161
- if (this.lastDoc) doc = this.lastDoc;
162
- params = JSDOC.Walker.onParamList(this.ts.balance("LEFT_PAREN"));
163
-
164
- symbol = new JSDOC.Symbol(name, params, "FUNCTION", doc, opts);
165
- if (isInner) symbol.isInner = true;
166
-
167
- JSDOC.Parser.addSymbol(symbol);
168
-
169
- this.namescope.push(symbol);
170
-
171
- var matching = this.ts.getMatchingToken("LEFT_CURLY");
172
- if (matching) matching.matching.popNamescope = name;
173
- else LOG.warn("Mismatched } character. Can't parse code.");
174
- }
175
- // foo = new function() {}
176
- else if (this.ts.look(1).is("ASSIGN") && this.ts.look(2).is("NEW") && this.ts.look(3).is("FUNCTION")) {
177
- var isInner;
178
- if (this.ts.look(-1).is("VAR") || this.isInner) {
179
- name = this.namescope.last().alias+"-"+name
180
- if (!this.namescope.last().is("GLOBAL")) isInner = true;
181
- }
182
- else if (name.indexOf("this.") == 0) {
183
- name = this.resolveThis(name);
184
- }
185
-
186
- if (this.lastDoc) doc = this.lastDoc;
187
- params = JSDOC.Walker.onParamList(this.ts.balance("LEFT_PAREN"));
188
-
189
- symbol = new JSDOC.Symbol(name, params, "OBJECT", doc,opts);
190
- if (isInner) symbol.isInner = true;
191
-
192
-
193
- JSDOC.Parser.addSymbol(symbol);
194
-
195
- symbol.scopeType = "INSTANCE";
196
- this.namescope.push(symbol);
197
-
198
- var matching = this.ts.getMatchingToken("LEFT_CURLY");
199
- if (matching) matching.matching.popNamescope = name;
200
- else LOG.warn("Mismatched } character. Can't parse code.");
201
- }
202
- // foo: function() {}
203
- else if (this.ts.look(1).is("COLON") && this.ts.look(2).is("FUNCTION")) {
204
- name = (this.namescope.last().alias+"."+name).replace("#.", "#");
205
-
206
- if (this.lastDoc) doc = this.lastDoc;
207
- params = JSDOC.Walker.onParamList(this.ts.balance("LEFT_PAREN"));
208
-
209
- var matching = this.ts.getMatchingToken("LEFT_CURLY");
210
-
211
- if(matching && name.indexOf('Observer') != -1)
212
- {
213
- LOG.warn("index: " + matching.index);
214
- // LOG.warn(this.ts.next(15));
215
-
216
- LOG.warn(this.ts.look(matching.index-2));
217
- LOG.warn(this.ts.look(matching.index-1));
218
- LOG.warn(this.ts.look(matching.index));
219
- LOG.warn(this.ts.look(matching.index+1));
220
- LOG.warn(this.ts.look(matching.index+2));
221
- LOG.warn(this.ts.look(matching.index+3));
222
- LOG.warn(this.ts.look(matching.index+4));
223
- LOG.warn('===');
224
- }
225
- // LOG.warn(matching.index);
226
-
227
-
228
- //var opts = {isBinding: false, isObserver: false, bindingPath: '', observedProperties: []};
229
- // LOG.warn(this.ts.next(10));
230
- if(name.indexOf('Binding') != -1)
231
- {
232
- opts.isBinding = true;
233
- opts.bindingPath = this.ts.look(2);
234
- }
235
-
236
-
237
-
238
- if (doc && doc.getTag("constructs").length) {
239
- name = name.replace(/\.prototype(\.|$)/, "#");
240
-
241
- if (name.indexOf("#") > -1) name = name.match(/(^[^#]+)/)[0];
242
- else name = this.namescope.last().alias;
243
-
244
- symbol = new JSDOC.Symbol(name, params, "CONSTRUCTOR", doc, opts);
245
- }
246
- else {
247
- symbol = new JSDOC.Symbol(name, params, "FUNCTION", doc, opts);
248
- }
249
-
250
-
251
- JSDOC.Parser.addSymbol(symbol);
252
-
253
- this.namescope.push(symbol);
254
-
255
- if (matching) matching.matching.popNamescope = name;
256
- else LOG.warn("Mismatched } character. Can't parse code.");
257
- }
258
- // foo = {}
259
- else if (this.ts.look(1).is("ASSIGN") && this.ts.look(2).is("LEFT_CURLY")) {
260
- var isInner;
261
- if (this.ts.look(-1).is("VAR") || this.isInner) {
262
- name = this.namescope.last().alias+"-"+name
263
- if (!this.namescope.last().is("GLOBAL")) isInner = true;
264
- }
265
- else if (name.indexOf("this.") == 0) {
266
- name = this.resolveThis(name);
267
- }
268
-
269
- if (this.lastDoc) doc = this.lastDoc;
270
-
271
- symbol = new JSDOC.Symbol(name, params, "OBJECT", doc, opts);
272
- if (isInner) symbol.isInner = true;
273
-
274
-
275
- if (doc) JSDOC.Parser.addSymbol(symbol);
276
-
277
- this.namescope.push(symbol);
278
-
279
- var matching = this.ts.getMatchingToken("LEFT_CURLY");
280
- if (matching) matching.matching.popNamescope = name;
281
- else LOG.warn("Mismatched } character. Can't parse code.");
282
- }
283
- // foo = x
284
- else if (this.ts.look(1).is("ASSIGN")) {
285
-
286
- var isInner;
287
- if (this.ts.look(-1).is("VAR") || this.isInner) {
288
- name = this.namescope.last().alias+"-"+name
289
- if (!this.namescope.last().is("GLOBAL")) isInner = true;
290
- }
291
- else if (name.indexOf("this.") == 0) {
292
- name = this.resolveThis(name);
293
- }
294
-
295
- if (this.lastDoc) doc = this.lastDoc;
296
-
297
- symbol = new JSDOC.Symbol(name, params, "OBJECT", doc, opts);
298
- if (isInner) symbol.isInner = true;
299
-
300
-
301
- if (doc) JSDOC.Parser.addSymbol(symbol);
302
- }
303
- // foo: {}
304
- else if (this.ts.look(1).is("COLON") && this.ts.look(2).is("LEFT_CURLY")) {
305
- name = (this.namescope.last().alias+"."+name).replace("#.", "#");
306
-
307
- if (this.lastDoc) doc = this.lastDoc;
308
-
309
- symbol = new JSDOC.Symbol(name, params, "OBJECT", doc, opts);
310
-
311
-
312
- if (doc) JSDOC.Parser.addSymbol(symbol);
313
-
314
- this.namescope.push(symbol);
315
-
316
- var matching = this.ts.getMatchingToken("LEFT_CURLY");
317
- if (matching) matching.matching.popNamescope = name;
318
- else LOG.warn("Mismatched } character. Can't parse code.");
319
- }
320
- // foo: x
321
- else if (this.ts.look(1).is("COLON")) {
322
- name = (this.namescope.last().alias+"."+name).replace("#.", "#");;
323
-
324
- if (this.lastDoc) doc = this.lastDoc;
325
-
326
- //var opts = {isBinding: false, isObserver: false, bindingPath: '', observedProperties: []};
327
- //LOG.warn(this.ts.look(2));
328
- // if(name.indexOf('Binding') != -1)
329
- // {
330
- // opts.isBinding = true;
331
- // opts.bindingPath = this.ts.look(2);
332
- // }
333
-
334
- symbol = new JSDOC.Symbol(name, params, "OBJECT", doc, opts);
335
-
336
-
337
- if (doc) JSDOC.Parser.addSymbol(symbol);
338
- }
339
- // foo(...)
340
- else if (this.ts.look(1).is("LEFT_PAREN")) {
341
- var functionCall = {name: name};
342
- if (!this.ts.look(2).is("RIGHT_PAREN")) functionCall.arg1 = this.ts.look(2).data;
343
-
344
- if (typeof JSDOC.PluginManager != "undefined") {
345
- JSDOC.PluginManager.run("onFunctionCall", functionCall);
346
- if (functionCall.doc) {
347
- this.ts.insertAhead(new JSDOC.Token(functionCall.doc, "COMM", "JSDOC"));
348
- }
349
- }
350
- }
351
- this.lastDoc = null;
352
- }
353
- else if (this.token.is("FUNCTION")) { // it's an anonymous function
354
- if (
355
- (!this.ts.look(-1).is("COLON") || !this.ts.look(-1).is("ASSIGN"))
356
- && !this.ts.look(1).is("NAME")
357
- ) {
358
- if (this.lastDoc) doc = this.lastDoc;
359
-
360
- name = "$anonymous";
361
- name = this.namescope.last().alias+"-"+name
362
-
363
- params = JSDOC.Walker.onParamList(this.ts.balance("LEFT_PAREN"));
364
-
365
- symbol = new JSDOC.Symbol(name, params, "FUNCTION", doc, opts);
366
-
367
-
368
- JSDOC.Parser.addSymbol(symbol);
369
-
370
- this.namescope.push(symbol);
371
-
372
- var matching = this.ts.getMatchingToken("LEFT_CURLY");
373
- if (matching) matching.matching.popNamescope = name;
374
- else LOG.warn("Mismatched } character. Can't parse code.");
375
- }
376
- }
377
- }
378
- return true;
379
- }
380
-
381
- /**
382
- Resolves what "this." means when it appears in a name.
383
- @param name The name that starts with "this.".
384
- @returns The name with "this." resolved.
385
- */
386
- JSDOC.Walker.prototype.resolveThis = function(name) {
387
- name.match(/^this\.(.+)$/)
388
- var nameFragment = RegExp.$1;
389
- if (!nameFragment) return name;
390
-
391
- var symbol = this.namescope.last();
392
- var scopeType = symbol.scopeType || symbol.isa;
393
-
394
- // if we are in a constructor function, `this` means the instance
395
- if (scopeType == "CONSTRUCTOR") {
396
- name = symbol.alias+"#"+nameFragment;
397
- }
398
-
399
- // if we are in an anonymous constructor function, `this` means the instance
400
- else if (scopeType == "INSTANCE") {
401
- name = symbol.alias+"."+nameFragment;
402
- }
403
-
404
- // if we are in a function, `this` means the container (possibly the global)
405
- else if (scopeType == "FUNCTION") {
406
- // in a method of a prototype, so `this` means the constructor
407
- if (symbol.alias.match(/(^.*)[#.-][^#.-]+/)) {
408
- var parentName = RegExp.$1;
409
- var parent = JSDOC.Parser.symbols.getSymbol(parentName);
410
-
411
- if (!parent) {
412
- if (JSDOC.Lang.isBuiltin(parentName)) parent = JSDOC.Parser.addBuiltin(parentName);
413
- else {
414
- if (symbol.alias.indexOf("$anonymous") < 0) // these will be ignored eventually
415
- LOG.warn("Can't document "+symbol.alias+" without first documenting "+parentName+".");
416
- }
417
- }
418
- if (parent) name = parentName+(parent.is("CONSTRUCTOR")?"#":".")+nameFragment;
419
- }
420
- else {
421
- parent = this.namescope.last(1);
422
- name = parent.alias+(parent.is("CONSTRUCTOR")?"#":".")+nameFragment;
423
- }
424
- }
425
- // otherwise it means the global
426
- else {
427
- name = nameFragment;
428
- }
429
-
430
- return name;
431
- }
432
-
433
- JSDOC.Walker.onParamList = function(/**Array*/paramTokens) {
434
- if (!paramTokens) {
435
- LOG.warn("Malformed parameter list. Can't parse code.");
436
- return [];
437
- }
438
- var params = [];
439
- for (var i = 0, l = paramTokens.length; i < l; i++) {
440
- if (paramTokens[i].is("JSDOC")) {
441
- var paramType = paramTokens[i].data.replace(/(^\/\*\* *| *\*\/$)/g, "");
442
-
443
- if (paramTokens[i+1] && paramTokens[i+1].is("NAME")) {
444
- i++;
445
- params.push({type: paramType, name: paramTokens[i].data});
446
- }
447
- }
448
- else if (paramTokens[i].is("NAME")) {
449
- params.push({name: paramTokens[i].data});
450
- }
451
- }
452
- return params;
453
- }