sproutcore 0.9.13 → 0.9.14
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +19 -0
- data/Manifest.txt +103 -26
- data/app_generators/sproutcore/templates/README +1 -1
- data/bin/sc-build +1 -1
- data/bin/sc-gen +0 -0
- data/bin/sc-ide +278 -0
- data/bin/sc-init +38 -0
- data/bin/sc-install +96 -0
- data/bin/sc-remove +94 -0
- data/bin/sc-server +4 -0
- data/bin/sc-update +94 -0
- data/bin/sproutcore +3 -14
- data/clients/sc_docs/controllers/docs.js +1 -1
- data/clients/sc_docs/models/doc.js +6 -0
- data/clients/sc_docs/views/doc_frame.js +1 -1
- data/clients/sc_test_runner/english.lproj/icons/small/next.png +0 -0
- data/clients/sc_test_runner/english.lproj/icons/small/reset.png +0 -0
- data/frameworks/sproutcore/HISTORY +34 -2
- data/frameworks/sproutcore/controllers/array.js +1 -1
- data/frameworks/sproutcore/controllers/controller.js +1 -1
- data/frameworks/sproutcore/controllers/object.js +9 -6
- data/frameworks/sproutcore/core.js +19 -4
- data/frameworks/sproutcore/english.lproj/blank.gif +0 -0
- data/frameworks/sproutcore/english.lproj/core.css +1 -0
- data/frameworks/sproutcore/english.lproj/menu.css +1 -0
- data/frameworks/sproutcore/foundation/application.js +3 -3
- data/frameworks/sproutcore/foundation/benchmark.js +1 -1
- data/frameworks/sproutcore/foundation/node_descriptor.js +13 -1
- data/frameworks/sproutcore/foundation/page.js +3 -2
- data/frameworks/sproutcore/foundation/path_module.js +33 -16
- data/frameworks/sproutcore/foundation/run_loop.js +1 -1
- data/frameworks/sproutcore/foundation/server.js +68 -18
- data/frameworks/sproutcore/foundation/string.js +1 -1
- data/frameworks/sproutcore/globals/window.js +62 -15
- data/frameworks/sproutcore/lib/core_views.rb +1 -0
- data/frameworks/sproutcore/lib/index.rhtml +4 -3
- data/frameworks/sproutcore/lib/menu_views.rb +2 -2
- data/frameworks/sproutcore/models/collection.js +122 -107
- data/frameworks/sproutcore/models/record.js +2 -2
- data/frameworks/sproutcore/panes/manager.js +1 -1
- data/frameworks/sproutcore/panes/overlay.js +3 -3
- data/frameworks/sproutcore/tests/controllers/object.rhtml +26 -0
- data/frameworks/sproutcore/tests/views/collection/incremental_rendering.rhtml +2 -2
- data/frameworks/sproutcore/views/button/disclosure.js +1 -1
- data/frameworks/sproutcore/views/collection/collection.js +19 -15
- data/frameworks/sproutcore/views/collection/source_list.js +1 -1
- data/frameworks/sproutcore/views/collection/table.js +2 -2
- data/frameworks/sproutcore/views/error_explanation.js +1 -1
- data/frameworks/sproutcore/views/field/checkbox_field.js +1 -1
- data/frameworks/sproutcore/views/field/field.js +1 -1
- data/frameworks/sproutcore/views/field/radio_field.js +1 -1
- data/frameworks/sproutcore/views/field/select_field.js +1 -1
- data/frameworks/sproutcore/views/form.js +1 -1
- data/frameworks/sproutcore/views/image.js +1 -1
- data/frameworks/sproutcore/views/menu_item.js +1 -1
- data/frameworks/sproutcore/views/popup_button.js +1 -1
- data/frameworks/sproutcore/views/popup_menu.js +1 -1
- data/frameworks/sproutcore/views/progress.js +4 -2
- data/frameworks/sproutcore/views/radio_group.js +1 -1
- data/frameworks/sproutcore/views/scroll.js +1 -1
- data/frameworks/sproutcore/views/source_list_group.js +1 -1
- data/frameworks/sproutcore/views/split.js +1 -1
- data/frameworks/sproutcore/views/tab.js +3 -1
- data/frameworks/sproutcore/views/view.js +19 -3
- data/jsdoc/README.txt +89 -57
- data/jsdoc/app/frame/Chain.js +102 -0
- data/jsdoc/app/frame/Dumper.js +144 -0
- data/jsdoc/app/frame/Hash.js +47 -0
- data/jsdoc/app/frame/Link.js +142 -0
- data/jsdoc/app/frame/Namespace.js +10 -0
- data/jsdoc/app/frame/Opt.js +134 -0
- data/jsdoc/app/frame/Reflection.js +26 -0
- data/jsdoc/app/frame/String.js +93 -0
- data/jsdoc/app/frame/Testrun.js +129 -0
- data/jsdoc/app/frame.js +33 -0
- data/jsdoc/app/handlers/FOODOC.js +26 -0
- data/jsdoc/app/handlers/XMLDOC/DomReader.js +159 -0
- data/jsdoc/app/handlers/XMLDOC/XMLDoc.js +16 -0
- data/jsdoc/app/handlers/XMLDOC/XMLParse.js +292 -0
- data/jsdoc/app/handlers/XMLDOC.js +26 -0
- data/jsdoc/app/lib/JSDOC/DocComment.js +200 -0
- data/jsdoc/app/lib/JSDOC/DocTag.js +294 -0
- data/jsdoc/app/lib/JSDOC/JsDoc.js +180 -0
- data/jsdoc/app/lib/JSDOC/JsPlate.js +100 -0
- data/jsdoc/app/lib/JSDOC/Lang.js +144 -0
- data/jsdoc/app/lib/JSDOC/Parser.js +109 -0
- data/jsdoc/app/lib/JSDOC/PluginManager.js +33 -0
- data/jsdoc/app/lib/JSDOC/Symbol.js +600 -0
- data/jsdoc/app/lib/JSDOC/SymbolSet.js +220 -0
- data/jsdoc/app/lib/JSDOC/TextStream.js +41 -0
- data/jsdoc/app/lib/JSDOC/Token.js +18 -0
- data/jsdoc/app/lib/JSDOC/TokenReader.js +323 -0
- data/jsdoc/app/lib/JSDOC/TokenStream.js +133 -0
- data/jsdoc/app/lib/JSDOC/Util.js +32 -0
- data/jsdoc/app/lib/JSDOC/Walker.js +416 -0
- data/jsdoc/app/lib/JSDOC.js +97 -0
- data/jsdoc/app/main.js +74 -0
- data/jsdoc/app/plugins/commentSrcJson.js +19 -0
- data/jsdoc/app/plugins/frameworkPrototype.js +16 -0
- data/jsdoc/app/plugins/functionCall.js +10 -0
- data/jsdoc/app/plugins/publishSrcHilite.js +62 -0
- data/jsdoc/app/plugins/sproutcoreTags.js +26 -0
- data/jsdoc/app/plugins/symbolLink.js +9 -0
- data/jsdoc/app/plugins/tagParamConfig.js +31 -0
- data/jsdoc/app/plugins/tagSynonyms.js +43 -0
- data/jsdoc/app/run.js +339 -137
- data/jsdoc/changes.txt +47 -0
- data/jsdoc/conf/sample.conf +31 -0
- data/jsdoc/java/build.xml +36 -0
- data/jsdoc/java/build_1.4.xml +36 -0
- data/jsdoc/java/classes/js.jar +0 -0
- data/jsdoc/java/src/JsDebugRun.java +21 -0
- data/jsdoc/java/src/JsRun.java +21 -0
- data/jsdoc/jsdebug.jar +0 -0
- data/jsdoc/jsrun.jar +0 -0
- data/jsdoc/t/TestDoc.js +144 -0
- data/jsdoc/t/runner.js +13 -0
- data/jsdoc/templates/sproutcore/allclasses.tmpl +17 -0
- data/jsdoc/templates/sproutcore/allfiles.tmpl +56 -0
- data/jsdoc/templates/sproutcore/class.tmpl +408 -326
- data/jsdoc/templates/sproutcore/index.tmpl +30 -31
- data/jsdoc/templates/sproutcore/publish.js +173 -81
- data/jsdoc/templates/sproutcore/static/default.css +191 -0
- data/jsdoc/templates/sproutcore/static/header.html +2 -0
- data/jsdoc/templates/sproutcore/static/index.html +19 -0
- data/jsdoc/templates/sproutcore/symbol.tmpl +35 -0
- data/jsdoc/test/addon.js +24 -0
- data/jsdoc/test/anon_inner.js +14 -0
- data/jsdoc/test/augments.js +31 -0
- data/jsdoc/test/augments2.js +26 -0
- data/jsdoc/test/borrows.js +41 -0
- data/jsdoc/test/borrows2.js +23 -0
- data/jsdoc/test/config.js +22 -0
- data/jsdoc/test/constructs.js +18 -0
- data/jsdoc/test/encoding.js +10 -0
- data/jsdoc/test/encoding_other.js +12 -0
- data/jsdoc/test/functions_anon.js +39 -0
- data/jsdoc/test/functions_nested.js +33 -0
- data/jsdoc/test/global.js +13 -0
- data/jsdoc/test/globals.js +25 -0
- data/jsdoc/test/ignore.js +10 -0
- data/jsdoc/test/inner.js +16 -0
- data/jsdoc/test/jsdoc_test.js +477 -0
- data/jsdoc/test/lend.js +33 -0
- data/jsdoc/test/memberof.js +20 -0
- data/jsdoc/test/memberof_constructor.js +15 -0
- data/jsdoc/test/name.js +19 -0
- data/jsdoc/test/namespace_nested.js +23 -0
- data/jsdoc/test/nocode.js +13 -0
- data/jsdoc/test/oblit_anon.js +20 -0
- data/jsdoc/test/overview.js +20 -0
- data/jsdoc/test/param_inline.js +37 -0
- data/jsdoc/test/params_optional.js +8 -0
- data/jsdoc/test/prototype.js +17 -0
- data/jsdoc/test/prototype_nested.js +9 -0
- data/jsdoc/test/prototype_oblit.js +13 -0
- data/jsdoc/test/prototype_oblit_constructor.js +24 -0
- data/jsdoc/test/public.js +10 -0
- data/jsdoc/test/shared.js +42 -0
- data/jsdoc/test/shared2.js +2 -0
- data/jsdoc/test/shortcuts.js +22 -0
- data/jsdoc/test/static_this.js +13 -0
- data/jsdoc/test/synonyms.js +23 -0
- data/jsdoc/test/tosource.js +23 -0
- data/jsdoc/test/variable_redefine.js +14 -0
- data/jsdoc/test.js +304 -0
- data/lib/sproutcore/build_tools/resource_builder.rb +6 -1
- data/lib/sproutcore/bundle_installer.rb +268 -0
- data/lib/sproutcore/jsdoc.rb +7 -6
- data/lib/sproutcore/library.rb +38 -0
- data/lib/sproutcore/merb/bundle_controller.rb +8 -4
- data/lib/sproutcore/version.rb +1 -1
- data/lib/sproutcore.rb +1 -1
- data/script/destroy +0 -0
- data/script/generate +0 -0
- data/script/txt2html +0 -0
- metadata +117 -29
- data/clients/view_builder/core.js +0 -19
- data/clients/view_builder/english.lproj/body.css +0 -149
- data/clients/view_builder/english.lproj/body.rhtml +0 -18
- data/clients/view_builder/english.lproj/strings.js +0 -14
- data/clients/view_builder/main.js +0 -37
- data/jsdoc/app/DocFile.js +0 -137
- data/jsdoc/app/DocTag.js +0 -110
- data/jsdoc/app/Doclet.js +0 -63
- data/jsdoc/app/Dumper.js +0 -143
- data/jsdoc/app/JsDoc.js +0 -103
- data/jsdoc/app/JsHilite.js +0 -45
- data/jsdoc/app/JsIO.js +0 -163
- data/jsdoc/app/JsParse.js +0 -385
- data/jsdoc/app/JsPlate.js +0 -130
- data/jsdoc/app/JsTestrun.js +0 -129
- data/jsdoc/app/JsToke.js +0 -564
- data/jsdoc/app/Symbol.js +0 -298
- data/jsdoc/app/Transformer.js +0 -14
- data/jsdoc/app/Util.js +0 -97
- data/jsdoc/app/js.jar +0 -0
- data/jsdoc/plugins/min.js +0 -316
- data/jsdoc/plugins/strip.js +0 -20
- data/jsdoc/templates/sproutcore/default.css +0 -191
- data/jsdoc/templates/sproutcore/index.html +0 -13
- data/jsdoc/templates/sproutcore/prototype.js +0 -4186
- data/jsdoc/templates/sproutcore/splash.html +0 -7
@@ -0,0 +1,24 @@
|
|
1
|
+
/** @constructor */
|
2
|
+
function Article() {
|
3
|
+
}
|
4
|
+
|
5
|
+
Article.prototype = {
|
6
|
+
/** @constructor */
|
7
|
+
Title: function(title) {
|
8
|
+
/** the value of the Title instance */
|
9
|
+
this.title = title;
|
10
|
+
},
|
11
|
+
|
12
|
+
init: function(pages) {
|
13
|
+
/** the value of the pages of the Article instance */
|
14
|
+
this.pages = pages;
|
15
|
+
}
|
16
|
+
}
|
17
|
+
|
18
|
+
f = new Article();
|
19
|
+
f.init("one two three");
|
20
|
+
|
21
|
+
t = new f.Title("my title");
|
22
|
+
|
23
|
+
print(f.pages);
|
24
|
+
print(t.title);
|
@@ -0,0 +1,42 @@
|
|
1
|
+
|
2
|
+
/**
|
3
|
+
* Builtin object.
|
4
|
+
* @class
|
5
|
+
* @name Array
|
6
|
+
*/
|
7
|
+
|
8
|
+
/**#@+
|
9
|
+
* Extension to builtin array.
|
10
|
+
* @memberOf Array
|
11
|
+
* @method
|
12
|
+
*/
|
13
|
+
|
14
|
+
/**
|
15
|
+
* @returns Boolen if some array members...
|
16
|
+
*/
|
17
|
+
Array.prototype.some = function(){};
|
18
|
+
|
19
|
+
/**
|
20
|
+
* Change every element of an array.
|
21
|
+
* @returns Filtered array copy.
|
22
|
+
*/
|
23
|
+
Array.prototype.filter = function(){};
|
24
|
+
|
25
|
+
/**#@-*/
|
26
|
+
|
27
|
+
|
28
|
+
/**
|
29
|
+
* A first in, first out data structure.
|
30
|
+
* @constructor
|
31
|
+
*/
|
32
|
+
Queue = function(){};
|
33
|
+
|
34
|
+
/**#@+
|
35
|
+
* Extension to Queue.
|
36
|
+
* @memberOf Queue
|
37
|
+
*/
|
38
|
+
|
39
|
+
rewind = function(){
|
40
|
+
}
|
41
|
+
|
42
|
+
// should close automatically here.
|
@@ -0,0 +1,22 @@
|
|
1
|
+
// /**#=+
|
2
|
+
// * {
|
3
|
+
// * 'D': 'Date.prototype',
|
4
|
+
// * '$N': 'Number'
|
5
|
+
// * }
|
6
|
+
// */
|
7
|
+
// var D = Date.prototype,
|
8
|
+
// $N = Number;
|
9
|
+
//
|
10
|
+
// D.locale = function(){
|
11
|
+
// };
|
12
|
+
//
|
13
|
+
// /**
|
14
|
+
// @return {string} The cardinal number string.
|
15
|
+
// */
|
16
|
+
// $N.nth = function(n){
|
17
|
+
// };
|
18
|
+
//
|
19
|
+
// LOAD.file = function(){
|
20
|
+
// }
|
21
|
+
//
|
22
|
+
// /**#=-*/
|
@@ -0,0 +1,23 @@
|
|
1
|
+
/**
|
2
|
+
@class
|
3
|
+
@inherits Bar#zop as #my_zop
|
4
|
+
*/
|
5
|
+
function Foo() {
|
6
|
+
/** this is a zip. */
|
7
|
+
this.zip = function() {}
|
8
|
+
|
9
|
+
/** from Bar */
|
10
|
+
this.my_zop = new Bar().zop;
|
11
|
+
}
|
12
|
+
|
13
|
+
/**
|
14
|
+
@class
|
15
|
+
@borrows Foo#zip as this.my_zip
|
16
|
+
*/
|
17
|
+
function Bar() {
|
18
|
+
/** this is a zop. */
|
19
|
+
this.zop = function() {}
|
20
|
+
|
21
|
+
/** from Foo */
|
22
|
+
this.my_zip = new Foo().zip;
|
23
|
+
}
|
@@ -0,0 +1,23 @@
|
|
1
|
+
/**
|
2
|
+
* @param {Object} object
|
3
|
+
* @return {string}
|
4
|
+
*/
|
5
|
+
function valueOf(object) {}
|
6
|
+
|
7
|
+
/**
|
8
|
+
* @param {Object} object
|
9
|
+
* @return {string}
|
10
|
+
*/
|
11
|
+
function toString(object) {}
|
12
|
+
|
13
|
+
/**
|
14
|
+
* @param {Object} object
|
15
|
+
* @return {string}
|
16
|
+
*/
|
17
|
+
function toSource(object) {}
|
18
|
+
|
19
|
+
/**
|
20
|
+
* @param {Object} object
|
21
|
+
* @return {string}
|
22
|
+
*/
|
23
|
+
function constructor(object) {}
|
data/jsdoc/test.js
ADDED
@@ -0,0 +1,304 @@
|
|
1
|
+
load("app/frame/Dumper.js");
|
2
|
+
function symbolize(opt) {
|
3
|
+
symbols = null;
|
4
|
+
jsdoc = new JSDOC.JsDoc(opt);
|
5
|
+
symbols = jsdoc.symbolSet;
|
6
|
+
}
|
7
|
+
|
8
|
+
|
9
|
+
var testCases = [
|
10
|
+
function() {
|
11
|
+
symbolize({a:true, p:true, _: [SYS.pwd+"test/overview.js"]});
|
12
|
+
//print(Dumper.dump(symbols));
|
13
|
+
is('symbols.getSymbolByName("My Cool Library").name', 'My Cool Library', 'File overview can be found by alias.');
|
14
|
+
}
|
15
|
+
,
|
16
|
+
function() {
|
17
|
+
symbolize({_: [SYS.pwd+"test/name.js"]});
|
18
|
+
|
19
|
+
is('symbols.getSymbol("Response").name', "Response", 'Virtual class name is found.');
|
20
|
+
is('symbols.getSymbol("Response#text").alias', "Response#text", 'Virtual method name is found.');
|
21
|
+
is('symbols.getSymbol("Response#text").memberOf', "Response", 'Virtual method parent name is found.');
|
22
|
+
}
|
23
|
+
,
|
24
|
+
function() {
|
25
|
+
symbolize({a:true, p:true, _: [SYS.pwd+"test/prototype.js"]});
|
26
|
+
|
27
|
+
is('symbols.getSymbol("Article").name', "Article", 'Function set to constructor prototype with inner constructor name is found.');
|
28
|
+
is('symbols.getSymbol("Article").hasMethod("init")', true, 'The initializer method name of prototype function is correct.');
|
29
|
+
is('symbols.getSymbol("Article").hasMember("counter")', true, 'A static property set in the prototype definition is found.');
|
30
|
+
is('symbols.getSymbol("Article").hasMember("title")', true, 'An instance property set in the prototype is found.');
|
31
|
+
is('symbols.getSymbol("Article#title").isStatic', false, 'An instance property has isStatic set to false.');
|
32
|
+
is('symbols.getSymbol("Article.counter").name', "counter", 'A static property set in the initializer has the name set correctly.');
|
33
|
+
is('symbols.getSymbol("Article.counter").memberOf', "Article", 'A static property set in the initializer has the memberOf set correctly.');
|
34
|
+
is('symbols.getSymbol("Article.counter").isStatic', true, 'A static property set in the initializer has isStatic set to true.');
|
35
|
+
}
|
36
|
+
,
|
37
|
+
function() {
|
38
|
+
symbolize({a:true, _: [SYS.pwd+"test/prototype_oblit.js"]});
|
39
|
+
|
40
|
+
is('symbols.getSymbol("Article").name', "Article", 'Oblit set to constructor prototype name is found.');
|
41
|
+
is('typeof symbols.getSymbol("Article.prototype")', "undefined", 'The prototype oblit is not a symbol.');
|
42
|
+
is('symbols.getSymbol("Article#getTitle").name', "getTitle", 'The nonstatic method name of prototype oblit is correct.');
|
43
|
+
is('symbols.getSymbol("Article#getTitle").alias', "Article#getTitle", 'The alias of non-static method of prototype oblit is correct.');
|
44
|
+
is('symbols.getSymbol("Article#getTitle").isStatic', false, 'The isStatic of a nonstatic method of prototype oblit is correct.');
|
45
|
+
is('symbols.getSymbol("Article.getTitle").name', "getTitle", 'The static method name of prototype oblit is correct.');
|
46
|
+
is('symbols.getSymbol("Article.getTitle").isStatic', true, 'The isStatic of a static method of prototype oblit is correct.');
|
47
|
+
is('symbols.getSymbol("Article#getTitle").isa', "FUNCTION", 'The isa of non-static method of prototype oblit is correct.');
|
48
|
+
is('symbols.getSymbol("Article.getTitle").alias', "Article.getTitle", 'The alias of a static method of prototype oblit is correct.');
|
49
|
+
is('symbols.getSymbol("Article.getTitle").isa', "FUNCTION", 'The isa of static method of prototype oblit is correct.');
|
50
|
+
}
|
51
|
+
,
|
52
|
+
function() {
|
53
|
+
symbolize({a:true, p:true, _: [SYS.pwd+"test/prototype_oblit_constructor.js"]});
|
54
|
+
|
55
|
+
is('symbols.getSymbol("Article").name', "Article", 'Oblit set to constructor prototype with inner constructor name is found.');
|
56
|
+
is('symbols.getSymbol("Article#init").name', "init", 'The initializer method name of prototype oblit is correct.');
|
57
|
+
is('symbols.getSymbol("Article").hasMember("pages")', true, 'Property set by initializer method "this" is on the outer constructor.');
|
58
|
+
is('symbols.getSymbol("Article#Title").name', "Title", 'Name of the inner constructor name is found.');
|
59
|
+
is('symbols.getSymbol("Article#Title").memberOf', "Article", 'The memberOf of the inner constructor name is found.');
|
60
|
+
is('symbols.getSymbol("Article#Title").isa', "CONSTRUCTOR", 'The isa of the inner constructor name is constructor.');
|
61
|
+
is('symbols.getSymbol("Article#Title").hasMember("title")', true, 'A property set on the inner constructor "this" is on the inner constructor.');
|
62
|
+
}
|
63
|
+
,
|
64
|
+
function() {
|
65
|
+
symbolize({a:true, p:true, _: [SYS.pwd+"test/inner.js"]});
|
66
|
+
|
67
|
+
is('symbols.getSymbol("Outer").name', "Outer", 'Outer constructor prototype name is found.');
|
68
|
+
is('symbols.getSymbol("Outer").methods.length', 1, 'Inner function doesnt appear as a method of the outer.');
|
69
|
+
is('symbols.getSymbol("Outer").hasMethod("open")', true, 'Outer constructors methods arent affected by inner function.');
|
70
|
+
is('symbols.getSymbol("Outer-Inner").alias', "Outer-Inner", 'Alias of inner function is found.');
|
71
|
+
is('symbols.getSymbol("Outer-Inner").isa', "CONSTRUCTOR", 'isa of inner function constructor is found.');
|
72
|
+
is('symbols.getSymbol("Outer-Inner").memberOf', "Outer", 'The memberOf of inner function is found.');
|
73
|
+
is('symbols.getSymbol("Outer-Inner").name', "Inner", 'The name of inner function is found.');
|
74
|
+
is('symbols.getSymbol("Outer-Inner#name").name', "name", 'A member of the inner function constructor, attached to "this" is found on inner.');
|
75
|
+
is('symbols.getSymbol("Outer-Inner#name").memberOf', "Outer-Inner", 'The memberOf of an inner function member is found.');
|
76
|
+
}
|
77
|
+
,
|
78
|
+
function() {
|
79
|
+
symbolize({a:true, _: [SYS.pwd+"test/prototype_nested.js"]});
|
80
|
+
|
81
|
+
is('symbols.getSymbol("Word").name', "Word", 'Base constructor name is found.');
|
82
|
+
is('symbols.getSymbol("Word").hasMethod("reverse")', true, 'Base constructor method is found.');
|
83
|
+
is('symbols.getSymbol("Word").methods.length', 1, 'Base constructor has only one method.');
|
84
|
+
is('symbols.getSymbol("Word").memberOf', "", 'Base constructor memberOf is empty.');
|
85
|
+
is('symbols.getSymbol("Word#reverse").name', "reverse", 'Member of constructor prototype name is found.');
|
86
|
+
is('symbols.getSymbol("Word#reverse").memberOf', "Word", 'Member of constructor prototype memberOf is found.');
|
87
|
+
is('symbols.getSymbol("Word#reverse.utf8").name', "utf8", 'Member of constructor prototype method name is found.');
|
88
|
+
is('symbols.getSymbol("Word#reverse.utf8").memberOf', "Word#reverse", 'Static nested member memberOf is found.');
|
89
|
+
}
|
90
|
+
,
|
91
|
+
function() {
|
92
|
+
symbolize({a:true, _: [SYS.pwd+"test/namespace_nested.js"]});
|
93
|
+
|
94
|
+
is('symbols.getSymbol("ns1").name', "ns1", 'Base namespace name is found.');
|
95
|
+
is('symbols.getSymbol("ns1").memberOf', "", 'Base namespace memberOf is empty (its a constructor).');
|
96
|
+
is('symbols.getSymbol("ns1.ns2").name', "ns2", 'Nested namespace name is found.');
|
97
|
+
is('symbols.getSymbol("ns1.ns2").alias', "ns1.ns2", 'Nested namespace alias is found.');
|
98
|
+
is('symbols.getSymbol("ns1.ns2").memberOf', "ns1", 'Nested namespace memberOf is found.');
|
99
|
+
is('symbols.getSymbol("ns1.ns2.Function1").name', "Function1", 'Method of nested namespace name is found.');
|
100
|
+
is('symbols.getSymbol("ns1.ns2.Function1").memberOf', "ns1.ns2", 'Constructor of nested namespace memberOf is found.');
|
101
|
+
}
|
102
|
+
,
|
103
|
+
function() {
|
104
|
+
symbolize({a:true, p:true, _: [SYS.pwd+"test/functions_nested.js"]});
|
105
|
+
|
106
|
+
is('symbols.getSymbol("Zop").name', "Zop", 'Any constructor name is found.');
|
107
|
+
is('symbols.getSymbol("Zop").isa', "CONSTRUCTOR", 'It isa constructor.');
|
108
|
+
is('symbols.getSymbol("Zop").hasMethod("zap")', true, 'Its method name, set later, is in methods array.');
|
109
|
+
is('symbols.getSymbol("Foo").name', "Foo", 'The containing constructor name is found.');
|
110
|
+
is('symbols.getSymbol("Foo").hasMethod("methodOne")', true, 'Its method name is found.');
|
111
|
+
is('symbols.getSymbol("Foo").hasMethod("methodTwo")', true, 'Its second method name is found.');
|
112
|
+
is('symbols.getSymbol("Foo#methodOne").alias', "Foo#methodOne", 'A methods alias is found.');
|
113
|
+
is('symbols.getSymbol("Foo#methodOne").isStatic', false, 'A methods is not static.');
|
114
|
+
is('symbols.getSymbol("Bar").name', "Bar", 'A global function declared inside another function is found.');
|
115
|
+
is('symbols.getSymbol("Bar").isa', "FUNCTION", 'It isa function.');
|
116
|
+
is('symbols.getSymbol("Bar").memberOf', "_global_", 'It is global.');
|
117
|
+
is('symbols.getSymbol("Foo-inner").name', "inner", 'An inner functions name is found.');
|
118
|
+
is('symbols.getSymbol("Foo-inner").memberOf', "Foo", 'It is member of the outer function.');
|
119
|
+
is('symbols.getSymbol("Foo-inner").isInner', true, 'It is an inner function.');
|
120
|
+
}
|
121
|
+
,
|
122
|
+
function() {
|
123
|
+
symbolize({a:true, _: [SYS.pwd+"test/memberof_constructor.js"]});
|
124
|
+
|
125
|
+
is('symbols.getSymbol("Circle#Tangent").name', "Tangent", 'Constructor set on prototype using @member has correct name.');
|
126
|
+
is('symbols.getSymbol("Circle#Tangent").memberOf', "Circle", 'Constructor set on prototype using @member has correct memberOf.');
|
127
|
+
is('symbols.getSymbol("Circle#Tangent").alias', "Circle#Tangent", 'Constructor set on prototype using @member has correct alias.');
|
128
|
+
is('symbols.getSymbol("Circle#Tangent").isa', "CONSTRUCTOR", 'Constructor set on prototype using @member has correct isa.');
|
129
|
+
is('symbols.getSymbol("Circle#Tangent").isStatic', false, 'Constructor set on prototype using @member is not static.');
|
130
|
+
is('symbols.getSymbol("Circle#Tangent#getDiameter").name', "getDiameter", 'Method set on prototype using @member has correct name.');
|
131
|
+
is('symbols.getSymbol("Circle#Tangent#getDiameter").memberOf', "Circle#Tangent", 'Method set on prototype using @member has correct memberOf.');
|
132
|
+
is('symbols.getSymbol("Circle#Tangent#getDiameter").alias', "Circle#Tangent#getDiameter", 'Method set on prototype using @member has correct alias.');
|
133
|
+
is('symbols.getSymbol("Circle#Tangent#getDiameter").isa', "FUNCTION", 'Method set on prototype using @member has correct isa.');
|
134
|
+
is('symbols.getSymbol("Circle#Tangent#getDiameter").isStatic', false, 'Method set on prototype using @member is not static.');
|
135
|
+
}
|
136
|
+
,
|
137
|
+
function() {
|
138
|
+
symbolize({a:true, p: true, _: [SYS.pwd+"test/memberof.js"]});
|
139
|
+
|
140
|
+
is('symbols.getSymbol("pack.install").alias', "pack.install", 'Using @memberOf sets alias, when parent name is in memberOf tag.');
|
141
|
+
is('symbols.getSymbol("pack.install.overwrite").name', "install.overwrite", 'Using @memberOf sets name, even if the name is dotted.');
|
142
|
+
is('symbols.getSymbol("pack.install.overwrite").memberOf', "pack", 'Using @memberOf sets memberOf.');
|
143
|
+
is('symbols.getSymbol("pack.install.overwrite").isStatic', true, 'Using @memberOf with value not ending in octothorp sets isStatic to true.');
|
144
|
+
}
|
145
|
+
,
|
146
|
+
function() {
|
147
|
+
symbolize({a:true, p:true, _: [SYS.pwd+"test/borrows.js"]});
|
148
|
+
|
149
|
+
is('symbols.getSymbol("Layout").name', "Layout", 'Constructor can be found.');
|
150
|
+
is('symbols.getSymbol("Layout").hasMethod("init")', true, 'Constructor method name can be found.');
|
151
|
+
is('symbols.getSymbol("Layout").hasMember("orientation")', true, 'Constructor property name can be found.');
|
152
|
+
|
153
|
+
is('symbols.getSymbol("Page").hasMethod("reset")', true, 'Second constructor method name can be found.');
|
154
|
+
is('symbols.getSymbol("Page").hasMember("orientation")', true, 'Second constructor borrowed property name can be found in properties.');
|
155
|
+
is('symbols.getSymbol("Page#orientation").memberOf', "Page", 'Second constructor borrowed property memberOf can be found.');
|
156
|
+
is('symbols.getSymbol("Page").hasMethod("myGetInnerElements")', true, 'Can borrow an inner function, add it as a static function.');
|
157
|
+
|
158
|
+
is('symbols.getSymbol("ThreeColumnPage#init").alias', "ThreeColumnPage#init", 'Third constructor method can be found even though method with same name is borrowed.');
|
159
|
+
is('symbols.getSymbol("ThreeColumnPage#reset").alias', "ThreeColumnPage#reset", 'Borrowed method can be found.');
|
160
|
+
is('symbols.getSymbol("ThreeColumnPage#orientation").alias', "ThreeColumnPage#orientation", 'Twice borrowed method can be found.');
|
161
|
+
|
162
|
+
}
|
163
|
+
,
|
164
|
+
function() {
|
165
|
+
symbolize({a:true, p:true, _: [SYS.pwd+"test/borrows2.js"]});
|
166
|
+
|
167
|
+
is('symbols.getSymbol("Foo").hasMethod("my_zop")', true, 'Borrowed method can be found.');
|
168
|
+
is('symbols.getSymbol("Bar").hasMethod("my_zip")', true, 'Second borrowed method can be found.');
|
169
|
+
}
|
170
|
+
,
|
171
|
+
function() {
|
172
|
+
symbolize({a:true, p:true, _: [SYS.pwd+"test/constructs.js"]});
|
173
|
+
|
174
|
+
is('symbols.getSymbol("Person").hasMethod("say")', true, 'The constructs tag creates a class that lends can add a method to.');
|
175
|
+
}
|
176
|
+
,
|
177
|
+
function() {
|
178
|
+
symbolize({a: true, _: [SYS.pwd+"test/augments.js", SYS.pwd+"test/augments2.js"]});
|
179
|
+
|
180
|
+
is('symbols.getSymbol("Page").augments[0]', "Layout", 'An augmented class can be found.');
|
181
|
+
is('symbols.getSymbol("Page#reset").alias', "Page#reset", 'Method of augmenter can be found.');
|
182
|
+
is('symbols.getSymbol("Page").hasMethod("Layout#init")', true, 'Method from augmented can be found.');
|
183
|
+
is('symbols.getSymbol("Page").hasMember("Layout#orientation")', true, 'Property from augmented can be found.');
|
184
|
+
is('symbols.getSymbol("Page").methods.length', 3, 'Methods of augmented class are included in methods array.');
|
185
|
+
|
186
|
+
is('symbols.getSymbol("ThreeColumnPage").augments[0]', "Page", 'The extends tag is a synonym for augments.');
|
187
|
+
is('symbols.getSymbol("ThreeColumnPage").hasMethod("ThreeColumnPage#init")', true, 'Local method overrides augmented method of same name.');
|
188
|
+
is('symbols.getSymbol("ThreeColumnPage").methods.length', 3, 'Local method count is right.');
|
189
|
+
|
190
|
+
is('symbols.getSymbol("NewsletterPage").augments[0]', "ThreeColumnPage", 'Can augment across file boundaries.');
|
191
|
+
is('symbols.getSymbol("NewsletterPage").augments.length', 2, 'Multiple augments are supported.');
|
192
|
+
is('symbols.getSymbol("NewsletterPage").inherits[0].alias', "Junkmail#annoy", 'Inherited method with augments.');
|
193
|
+
is('symbols.getSymbol("NewsletterPage").methods.length', 6, 'Methods of augmented class are included in methods array across files.');
|
194
|
+
is('symbols.getSymbol("NewsletterPage").properties.length', 1, 'Properties of augmented class are included in properties array across files.');
|
195
|
+
}
|
196
|
+
,
|
197
|
+
function() {
|
198
|
+
symbolize({a:true, _: [SYS.pwd+"test/static_this.js"]});
|
199
|
+
|
200
|
+
is('symbols.getSymbol("box.holder").name', "holder", 'Static namespace name can be found.');
|
201
|
+
is('symbols.getSymbol("box.holder.foo").name', "foo", 'Static namespace method name can be found.');
|
202
|
+
is('symbols.getSymbol("box.holder").isStatic', true, 'Static namespace method is static.');
|
203
|
+
|
204
|
+
is('symbols.getSymbol("box.holder.counter").name', "counter", 'Instance namespace property name set on "this" can be found.');
|
205
|
+
is('symbols.getSymbol("box.holder.counter").alias', "box.holder.counter", 'Instance namespace property alias set on "this" can be found.');
|
206
|
+
is('symbols.getSymbol("box.holder.counter").memberOf', "box.holder", 'Static namespace property memberOf set on "this" can be found.');
|
207
|
+
}
|
208
|
+
,
|
209
|
+
function() {
|
210
|
+
symbolize({a:true, p: true, _: [SYS.pwd+"test/lend.js"]});
|
211
|
+
|
212
|
+
is('symbols.getSymbol("Person").name', "Person", 'Class defined in lend comment is found.');
|
213
|
+
is('symbols.getSymbol("Person").hasMethod("initialize")', true, 'Lent instance method name can be found.');
|
214
|
+
is('symbols.getSymbol("Person").hasMethod("say")', true, 'Second instance method can be found.');
|
215
|
+
is('symbols.getSymbol("Person#sing").isStatic', false, 'Instance method is known to be not static.');
|
216
|
+
|
217
|
+
is('symbols.getSymbol("Person.getCount").name', "getCount", 'Static method name from second lend comment can be found.');
|
218
|
+
is('symbols.getSymbol("Person.getCount").isStatic', true, 'Static method from second lend comment is known to be static.');
|
219
|
+
|
220
|
+
is('LOG.warnings.filter(function($){if($.indexOf("notok") > -1) return $}).length', 1, 'A warning is emitted when lending to an undocumented parent.');
|
221
|
+
}
|
222
|
+
,
|
223
|
+
function() {
|
224
|
+
symbolize({a:true, _: [SYS.pwd+"test/param_inline.js"]});
|
225
|
+
|
226
|
+
is('symbols.getSymbol("Layout").params[0].type', "int", 'Inline param name is set.');
|
227
|
+
is('symbols.getSymbol("Layout").params[0].desc', "The number of columns.", 'Inline param desc is set from comment.');
|
228
|
+
is('symbols.getSymbol("Layout#getElement").params[0].name', "id", 'User defined param documentation takes precedence over parser defined.');
|
229
|
+
is('symbols.getSymbol("Layout#getElement").params[0].isOptional', true, 'Default for param is to not be optional.');
|
230
|
+
is('symbols.getSymbol("Layout#getElement").params[1].isOptional', false, 'Can mark a param as being optional.');
|
231
|
+
is('symbols.getSymbol("Layout#getElement").params[1].type', "number|string", 'Type of inline param doc can have multiple values.');
|
232
|
+
is('symbols.getSymbol("Layout#Canvas").params[0].type', "", 'Type can be not defined for some params.');
|
233
|
+
is('symbols.getSymbol("Layout#Canvas").params[2].type', "int", 'Type can be defined inline for only some params.');
|
234
|
+
is('symbols.getSymbol("Layout#rotate").params.length', 0, 'Docomments inside function sig is ignored without a param.');
|
235
|
+
is('symbols.getSymbol("Layout#init").params[2].type', "zoppler", 'Doc comment type overrides inline type for param with same name.');
|
236
|
+
}
|
237
|
+
,
|
238
|
+
function() {
|
239
|
+
symbolize({a: true, _: [SYS.pwd+"test/shared.js", SYS.pwd+"test/shared2.js"]});
|
240
|
+
|
241
|
+
is('symbols.getSymbol("Array#some").name', 'some', 'The name of a symbol in a shared section is found.');
|
242
|
+
is('symbols.getSymbol("Array#some").alias', 'Array#some', 'The alias of a symbol in a shared section is found.');
|
243
|
+
is('symbols.getSymbol("Array#some").desc', "Extension to builtin array.", 'A description can be shared.');
|
244
|
+
is('symbols.getSymbol("Array#filter").desc', "Extension to builtin array.\nChange every element of an array.", 'A shared description is appended.');
|
245
|
+
is('symbols.getSymbol("Queue").desc', "A first in, first out data structure.", 'A description is not shared when outside a shared section.');
|
246
|
+
is('symbols.getSymbol("Queue.rewind").alias', "Queue.rewind", 'Second shared tag can be started.');
|
247
|
+
is('symbols.getSymbol("startOver").alias', "startOver", 'Shared tag doesnt cross over files.');
|
248
|
+
}
|
249
|
+
,
|
250
|
+
function() {
|
251
|
+
symbolize({a: true, _: [SYS.pwd+"test/config.js"]});
|
252
|
+
is('symbols.getSymbol("Contact").params[0].name', 'person', 'The name of a param is found.');
|
253
|
+
is('symbols.getSymbol("Contact").params[1].name', 'person.name', 'The name of a param set with a dot name is found.');
|
254
|
+
is('symbols.getSymbol("Contact").params[2].name', 'person.age', 'The name of a param set with a dot name is found.');
|
255
|
+
is('symbols.getSymbol("Contact").params[4].name', 'connection', 'The name of a param after config is found.');
|
256
|
+
|
257
|
+
is('symbols.getSymbol("Family").params[0].name', 'persons', 'Another name of a param is found.');
|
258
|
+
is('symbols.getSymbol("Family").params[1].name', 'persons.Father', 'The name of a param+config is found.');
|
259
|
+
is('symbols.getSymbol("Family").params[2].name', 'persons.Mother', 'The name of a second param+config is found.');
|
260
|
+
is('symbols.getSymbol("Family").params[3].name', 'persons.Children', 'The name of a third param+config is found.');
|
261
|
+
|
262
|
+
}
|
263
|
+
,
|
264
|
+
function() {
|
265
|
+
symbolize({a:true, p:true, _: [SYS.pwd+"test/ignore.js"]});
|
266
|
+
is('LOG.warnings.filter(function($){if($.indexOf("undocumented symbol Ignored") > -1) return $}).length', 1, 'A warning is emitted when documenting members of an ignored parent.');
|
267
|
+
|
268
|
+
}
|
269
|
+
,
|
270
|
+
function() {
|
271
|
+
symbolize({a:true, p:true, _: [SYS.pwd+"test/functions_anon.js"]});
|
272
|
+
is('symbols.getSymbol("a.b").alias', 'a.b', 'In anonymous constructor this is found to be the container object.');
|
273
|
+
is('symbols.getSymbol("a.f").alias', 'a.f', 'In anonymous constructor this can have a method.');
|
274
|
+
is('symbols.getSymbol("a.c").alias', 'a.c', 'In anonymous constructor method this is found to be the container object.');
|
275
|
+
is('symbols.getSymbol("g").alias', 'g', 'In anonymous function executed inline this is the global.');
|
276
|
+
is('symbols.getSymbol("bar2.p").alias', 'bar2.p', 'In named constructor executed inline this is the container object.');
|
277
|
+
is('symbols.getSymbol("module.pub").alias', 'module.pub', 'In parenthesized anonymous function executed inline function scoped variables arent documented.');
|
278
|
+
|
279
|
+
}
|
280
|
+
,
|
281
|
+
function() {
|
282
|
+
symbolize({a:true, p:true, _: [SYS.pwd+"test/oblit_anon.js"]});
|
283
|
+
is('symbols.getSymbol("opt").name', 'opt', 'Anonymous object properties are assigned to $anonymous.');
|
284
|
+
is('symbols.getSymbol("opt.conf.keep").alias', 'opt.conf.keep', 'Anonymous object properties are assigned to $anonymous.');
|
285
|
+
is('symbols.getSymbol("opt.conf.base").alias', 'opt.conf.base', 'Anonymous object properties are assigned to $anonymous.');
|
286
|
+
|
287
|
+
}
|
288
|
+
,
|
289
|
+
function() {
|
290
|
+
symbolize({a:true, p:true, _: [SYS.pwd+"test/params_optional.js"]});
|
291
|
+
is('symbols.getSymbol("Document").params.length', 3, 'Correct number of params are found when optional param syntax is used.');
|
292
|
+
is('symbols.getSymbol("Document").params[1].name', "id", 'Name of optional param is found.');
|
293
|
+
is('symbols.getSymbol("Document").params[1].isOptional', true, 'Optional param is marked isOptional.');
|
294
|
+
is('symbols.getSymbol("Document").params[2].name', "title", 'Name of optional param with default value is found.');
|
295
|
+
is('symbols.getSymbol("Document").params[2].isOptional', true, 'Optional param with default value is marked isOptional.');
|
296
|
+
is('symbols.getSymbol("Document").params[2].defaultValue', " This is untitled.", 'Optional param default value is found.');
|
297
|
+
|
298
|
+
|
299
|
+
}
|
300
|
+
];
|
301
|
+
|
302
|
+
|
303
|
+
//// run and print results
|
304
|
+
print(testrun(testCases));
|
@@ -163,7 +163,12 @@ module SproutCore
|
|
163
163
|
line = line.gsub(/["']@@.*["']\s*?:\s*?["'].*["'],\s*$/,'')
|
164
164
|
|
165
165
|
else
|
166
|
-
|
166
|
+
if line.match(/sc_super\(\s*\)/)
|
167
|
+
line = line.gsub(/sc_super\(\s*\)/, 'arguments.callee.base.apply(this,arguments)')
|
168
|
+
elsif line.match(/sc_super\(.+?\)/)
|
169
|
+
puts "\nWARNING: Calling sc_super() with arguments is DEPRECATED. Please use sc_super() only.\n\n"
|
170
|
+
line = line.gsub(/sc_super\((.+?)\)/, 'arguments.callee.base.apply(this, \1)')
|
171
|
+
end
|
167
172
|
end
|
168
173
|
|
169
174
|
super(line, filename)
|