Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

- initial commit

  • Loading branch information...
commit 949359f12a289256783e7f074662b83f30322a12 0 parents
@SamuraiJack authored
11 .gitignore
@@ -0,0 +1,11 @@
+_build
+Build
+blib
+.project
+.externalToolBuilders
+MANIFEST.bak
+Makefile.PL
+/doc/*
+/inc/*
+/META.json
+/Task.Joose.NodeJS-*.tar.gz
12 Build.PL
@@ -0,0 +1,12 @@
+use inc::Module::JSAN::DSL;
+
+name Task.Joose.NodeJS
+
+version 0.01
+author 'Nickolay (SamuraiJack) Platonov <nickolayp@cpan.org>'
+
+abstract 'Joose, packaged with NodeJS flavour'
+license lgpl
+
+
+docs_markup mmd
17 Changes
@@ -0,0 +1,17 @@
+Revision history for Task.Joose.NodeJS
+
+
+0.01 Mon, Jan 01, 2010
+
+ [ENHANCEMENTS]
+
+ - first release
+
+ [API CHANGES]
+
+ -none-
+
+
+ [BUG FIXES]
+
+ -none-
116 INSTALL
@@ -0,0 +1,116 @@
+The installation procedure for Task.Joose.NodeJS
+
+
+JSAN
+====
+
+`Task.Joose.NodeJS` is distributing via JSAN - [JavaScript Archive Network][jsan]. To install `Task.Joose.NodeJS` you'll need to install JSAN shell first - a small,
+cross-platform, unix-shell-like program. It communicate directly with closest JSAN mirror and can download and install any JSAN module for you.
+
+JSAN shell is written in perl, so the 1st step is to obtain Perl.
+
+
+1. OBTAINING PERL
+=================
+
+Linux
+-----
+
+If you are on any relatively modern Linux distribution, you may skip this step, since you already have perl and all required perl modules.
+
+
+Windows
+-------
+
+Windows users should install [Strawberry perl][straberry]. Straberry perl is preferable than ActiveState perl, because it comes with the compiler included.
+
+*NOTE:* After installation, you may need to relogin (or reboot) to see the updates in the PATH environment variable.
+
+
+2. INSTALLING SHELL
+===================
+
+Launch a console (`cmd` on Windows). Then type:
+
+ > cpan JSAN::Shell
+
+Thats all, now wait until shell will be installed. You may be asked about installing its pre-requisites - answer 'yes'.
+
+
+3. INSTALLING `Task.Joose.NodeJS`
+==========================
+
+Launch a console (`cmd` on Windows). Then type:
+
+ > jsan
+
+This should launch a JSAN shell and display a prompt, similar to this:
+
+ Checking for Internet access...
+ Locating closest JSAN mirror...
+
+ jsan shell -- JSAN repository explorer and package installer (v2.03)
+ -- Copyright 2005 - 2009 Adam Kennedy.
+ -- Type 'help' for a summary of available commands.
+
+ jsan>
+
+If this is the first time you installing the JSAN module, setup the installation path ('prefix' setting can be saved, so you won't need to enter again):
+
+ jsan> set prefix /your/installation/path/
+
+Then, type:
+
+ jsan> install Task.Joose.NodeJS
+
+Thats all, shell will download and install `Task.Joose.NodeJS` for you.
+
+For the list of available commands, try `help`. Also refer to [JSAN::Shell documentation](http://search.cpan.org/dist/JSAN-Shell/lib/JSAN/Shell.pm) for details.
+
+
+4. CONFIGURING YOUR SYSTEM
+==========================
+
+After successful completion of the procedure above, `Task.Joose.NodeJS` will be installed in your local JavaScript library (you've specified its location with 'prefix').
+
+For example, the path to the library can be:
+
+- /usr/local/lib/jsan
+
+on Linux systems
+
+- c:\JSAN
+
+on Windows systems.
+
+As a convention, its recommended to configure you local web server (you have one installed, right? ;) that way, that the root starting url `/jsan`
+will point at the `lib` subdirectory of JSAN library: `/usr/local/lib/jsan/lib` for example.
+
+This way you can load any installed JSAN module via url like: `/jsan/Useful/Module/Name.js`
+
+
+
+AUTHOR
+======
+
+Nickolay Platonov [nickolay8@gmail.com](mailto:nickolay8@gmail.com)
+
+
+COPYRIGHT AND LICENSE
+=====================
+
+Copyright (c) 2008-2009, Malte Ubl, Nickolay Platonov
+
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+
+* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+* Neither the name of Malte Ubl nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+[jsan]: http://openjsan.org
+[straberry]: http://strawberryperl.com/
20 MANIFEST
@@ -0,0 +1,20 @@
+bin/yuicompressor-2.4.2.jar
+Build.PL
+Changes
+doc/html/Task/Joose/NodeJS.html
+doc/mmd/Task/Joose/NodeJS.txt
+inc/Module/Build/Functions.pm
+inc/Module/Build/Functions/DSL.pm
+inc/Module/Build/JSAN.pm
+inc/Module/Build/JSAN/Installable.pm
+inc/Module/JSAN.pm
+inc/Module/JSAN/DSL.pm
+INSTALL
+lib/Task/Joose/NodeJS.js
+lib/Task/Joose/NodeJS.mmd
+MANIFEST
+META.json
+README.md
+script/create.pl
+t/010_sanity.t.js
+t/index.html
57 MANIFEST.SKIP
@@ -0,0 +1,57 @@
+# Avoid version control files.
+\bRCS\b
+\bCVS\b
+,v$
+\B\.svn\b
+\B\.cvsignore$
+
+# Avoid Makemaker generated and utility files.
+\bMakefile$
+\bblib
+\bMakeMaker-\d
+\bpm_to_blib$
+\bblibdirs$
+^MANIFEST\.SKIP$
+
+# Avoid VMS specific Makmaker generated files
+\bDescrip.MMS$
+\bDESCRIP.MMS$
+\bdescrip.mms$
+
+# Avoid Module::Build generated and utility files.
+\bBuild$
+\bBuild.bat$
+\b_build
+\bBuild.COM$
+\bBUILD.COM$
+\bbuild.com$
+
+# Avoid Devel::Cover generated files
+\bcover_db
+
+# Avoid temp and backup files.
+~$
+\.tmp$
+\.old$
+\.bak$
+\#$
+\.#
+\.rej$
+
+# Avoid OS-specific files/dirs
+# Mac OSX metadata
+\B\.DS_Store
+# Mac OSX SMB mount metadata files
+\B\._
+# Avoid archives of this distribution
+\.project$
+^\.git\b
+\.tar.gz$
+^tests/lib/
+^Task-Joose-NodeJS-*
+
+^\.externalToolBuilders\b
+^\.gitignore\b
+^TODO\b
+
+^MYMETA.yml$
112 README.md
@@ -0,0 +1,112 @@
+Name
+====
+
+
+Task.Joose.NodeJS - Joose, packaged with NodeJS flavour
+
+
+SYNOPSIS
+========
+
+ require('Task/Joose/NodeJS')
+
+
+ Role('Winged', {
+ has : {
+ leftWing : { is : 'rw' },
+ rightWing : { is : 'rw' }
+ },
+
+ methods : {
+
+ flight : function () {
+ this.leftWing.flutter()
+ this.rightWing.flutter()
+ },
+
+ land : function () {
+ this.leftWing.hold()
+ this.rightWing.hold()
+ }
+ }
+ })
+
+
+
+ Class('Bird', {
+ isa : Animal,
+
+ does : Winged
+ })
+
+
+ Class('Gryphon', {
+ isa : Lion,
+
+ does : Winged
+ })
+
+
+
+DESCRIPTION
+===========
+
+`Task.Joose.NodeJS` is a package, containing Joose along with several essential extensions:
+
+>* Joose 3.008 (XXX release)
+>* JooseX.Attribute 0.02 (XXX release)
+>* JooseX.Namespace.Depended 0.02|3 (XXX release)
+>* JooseX.CPS 0.02 (XXX release)
+
+
+EXAMPLES
+========
+
+
+GETTING HELP
+============
+
+This extension is supported via github issues tracker: <http://github.com/SamuraiJack/Task-Joose-NodeJS/issues>
+
+For general Joose questions you can also visit #joose on irc.freenode.org or the forum at: <http://joose.it/forum>
+
+
+
+SEE ALSO
+========
+
+Web page of this module: <http://github.com/SamuraiJack/Task-Joose-NodeJS/>
+
+General documentation for Joose: <http://openjsan.org/go/?l=Joose>
+
+
+BUGS
+====
+
+All complex software has bugs lurking in it, and this module is no exception.
+
+Please report any bugs through the web interface at <http://github.com/SamuraiJack/Task-Joose-NodeJS/issues>
+
+
+
+AUTHORS
+=======
+
+Nickolay Platonov <nplatonov@cpan.org>
+
+
+
+COPYRIGHT AND LICENSE
+=====================
+
+Copyright (c) 2009, Nickolay Platonov
+
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+
+* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+* Neither the name of Nickolay Platonov nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 TODO
@@ -0,0 +1,16 @@
+IDEAS
+=====
+
+
+
+TASKS
+=====
+
+
+
+
+DONE
+====
+
+
+
BIN  bin/yuicompressor-2.4.2.jar
Binary file not shown
1  lib/Task/Joose/NodeJS.js
@@ -0,0 +1 @@
+Joose=function(){throw"Modules may not be instantiated."};Joose.top=this;Joose.VERSION=3.008;Joose.AUTHORITY="jsan:NPLATONOV";Joose.A={each:function(f,d,c){c=c||this;for(var b=0,a=f.length;b<a;b++){if(d.call(c,f[b],b)===false){return false}}},exists:function(d,c){for(var b=0,a=d.length;b<a;b++){if(d[b]==c){return true}}return false},map:function(g,f,d){d=d||this;var c=[];for(var b=0,a=g.length;b<a;b++){c.push(f.call(d,g[b],b))}return c},grep:function(d,c){var b=[];Joose.A.each(d,function(a){if(c(a)){b.push(a)}});return b},remove:function(d,c){var b=[];Joose.A.each(d,function(a){if(a!==c){b.push(a)}});return b}};Joose.S={saneSplit:function(c,a){var b=(c||"").split(a);if(b.length==1&&!b[0]){b.shift()}return b},uppercaseFirst:function(a){return a.substr(0,1).toUpperCase()+a.substr(1,a.length-1)}};Joose.O={each:function(a,d,c){c=c||this;for(var b in a){if(d.call(c,a[b],b)===false){return false}}if(Joose.is_IE){return Joose.A.each(["toString","constructor","hasOwnProperty"],function(f){if(a.hasOwnProperty(f)){return d.call(c,a[f],f)}})}},eachOwn:function(a,c,b){b=b||this;return Joose.O.each(a,function(f,d){if(a.hasOwnProperty(d)){return c.call(b,f,d)}},b)},copy:function(a,b){b=b||{};Joose.O.each(a,function(d,c){b[c]=d});return b},copyOwn:function(a,b){b=b||{};Joose.O.eachOwn(a,function(d,c){b[c]=d});return b},getMutableCopy:function(a){var b=function(){};b.prototype=a;return new b()},extend:function(b,a){return Joose.O.copy(a,b)},isEmpty:function(a){for(var b in a){if(a.hasOwnProperty(b)){return false}}return true},isInstance:function(a){return a&&a.meta&&a.constructor==a.meta.c},wantArray:function(a){if(a instanceof Array){return a}return[a]},isFunction:function(a){return typeof a=="function"&&a.constructor!=RegExp}};Joose.I={Array:function(){return[]},Object:function(){return{}},Function:function(){return function(){}},Now:function(){return new Date()}};try{Joose.is_IE=/msie/i.test(navigator.userAgent)&&!/opera/i.test(navigator.userAgent)}catch(e){Joose.is_IE=false}try{Joose.is_NodeJS=Boolean(process.argv[0])}catch(e){Joose.is_NodeJS=false}Joose.Proto=function(){throw"Modules may not be instantiated."};Joose.Proto.Empty=function(){throw"Joose.Proto.Empty can't be instantiated"};Joose.Proto.Empty.meta={};(function(){Joose.Proto.Object=function(){throw"Joose.Proto.Object can't be instantiated"};var a=function(){var c=a.caller;if(c==b){c=c.caller}if(!c.SUPER){throw"Invalid call to SUPER"}return c.SUPER[c.methodName].apply(this,arguments)};var b=function(){return this.SUPER.apply(this,arguments[0])};Joose.Proto.Object.prototype={SUPERARG:b,SUPER:a,INNER:function(){throw"Invalid call to INNER"},BUILD:function(c){return arguments.length==1&&typeof c=="object"&&c||{}},initialize:function(){},toString:function(){return"a "+this.meta.name}};Joose.Proto.Object.meta={constructor:Joose.Proto.Object,methods:Joose.O.copy(Joose.Proto.Object.prototype),attributes:{}};Joose.Proto.Object.prototype.meta=Joose.Proto.Object.meta})();(function(){Joose.Proto.Class=function(){this.initialize(this.BUILD.apply(this,arguments))};var a={VERSION:null,AUTHORITY:null,constructor:Joose.Proto.Class,superClass:null,name:null,attributes:null,methods:null,meta:null,c:null,defaultSuperClass:Joose.Proto.Object,BUILD:function(b,c){this.name=b;return{__extend__:c||{}}},initialize:function(b){var c=b.__extend__;this.VERSION=c.VERSION;this.AUTHORITY=c.AUTHORITY;delete c.VERSION;delete c.AUTHORITY;this.c=this.extractConstructor(c);this.adaptConstructor(this.c);if(c.constructorOnly){delete c.constructorOnly;return}this.construct(c)},construct:function(c){if(!this.prepareProps(c)){return}var b=this.superClass=this.extractSuperClass(c);this.processSuperClass(b);this.adaptPrototype(this.c.prototype);this.finalize(c)},finalize:function(b){this.processStem(b);this.extend(b)},prepareProps:function(b){return true},extractConstructor:function(c){var b=c.hasOwnProperty("constructor")?c.constructor:this.defaultConstructor();delete c.constructor;return b},extractSuperClass:function(c){var b=c.isa||this.defaultSuperClass;delete c.isa;return b},processStem:function(){var b=this.superClass.meta||{};this.methods=Joose.O.getMutableCopy(b.methods||{});this.attributes=Joose.O.getMutableCopy(b.attributes||{})},initInstance:function(b,c){Joose.O.copyOwn(c,b)},defaultConstructor:function(){return function(){var c=this.BUILD.apply(this,arguments);this.meta.initInstance(this,c);var b=this.initialize;if(typeof b=="function"){b.call(this,c)}}},processSuperClass:function(b){this.c.prototype=Joose.O.getMutableCopy(b.prototype);this.c.superClass=b.prototype},adaptConstructor:function(b){b.meta=this;if(!b.hasOwnProperty("toString")){b.toString=function(){return this.meta.name}}},adaptPrototype:function(b){b.constructor=this.c;b.meta=this},addMethod:function(b,c){c.SUPER=this.superClass.prototype;c.methodName=b;this.methods[b]=c;this.c.prototype[b]=c},addAttribute:function(b,c){this.attributes[b]=c;this.c.prototype[b]=c},removeMethod:function(b){delete this.methods[b];delete this.c.prototype[b]},removeAttribute:function(b){delete this.attributes[b];delete this.c.prototype[b]},hasMethod:function(b){return Boolean(this.methods[b])},hasAttribute:function(b){return this.attributes[b]!==undefined},hasOwnMethod:function(b){return this.hasMethod(b)&&this.methods.hasOwnProperty(b)},hasOwnAttribute:function(b){return this.hasAttribute(b)&&this.attributes.hasOwnProperty(b)},extend:function(b){Joose.O.eachOwn(b,function(d,c){if(c!="meta"&&c!="constructor"){if(Joose.O.isFunction(d)&&!d.meta){this.addMethod(c,d)}else{this.addAttribute(c,d)}}},this)},subClassOf:function(b,c){c=c||{};c.isa=b||this.c;return new this.constructor(null,c).c},instantiate:function(){var b=function(){};b.prototype=this.c.prototype;var c=new b();return this.c.apply(c,arguments)||c}};Joose.Proto.Class.prototype=Joose.O.getMutableCopy(Joose.Proto.Object.prototype);Joose.O.extend(Joose.Proto.Class.prototype,a);Joose.Proto.Class.prototype.meta=new Joose.Proto.Class("Joose.Proto.Class",a);Joose.Proto.Class.meta.addMethod("isa",function(b){var c=function(){};c.prototype=this.c.prototype;return new c() instanceof b})})();Joose.Managed=function(){throw"Modules may not be instantiated."};Joose.Managed.Property=new Joose.Proto.Class("Joose.Managed.Property",{name:null,init:null,value:null,definedIn:null,initialize:function(a){Joose.Managed.Property.superClass.initialize.call(this,a);this.computeValue()},computeValue:function(){this.value=this.init},preApply:function(a){},postUnApply:function(a){},apply:function(a){a[this.name]=this.value},isAppliedTo:function(a){return a[this.name]==this.value},unapply:function(a){if(!this.isAppliedTo(a)){throw"Unapply of property ["+this.name+"] from ["+a+"] failed"}delete a[this.name]},cloneProps:function(){return{name:this.name,init:this.init,definedIn:this.definedIn}},clone:function(a){var b=this.cloneProps();b.name=a||b.name;return new this.constructor(b)}}).c;Joose.Managed.Property.ConflictMarker=new Joose.Proto.Class("Joose.Managed.Property.ConflictMarker",{isa:Joose.Managed.Property,apply:function(a){throw"Attempt to apply ConflictMarker ["+this.name+"] to ["+a+"]"}}).c;Joose.Managed.Property.Requirement=new Joose.Proto.Class("Joose.Managed.Property.Requirement",{isa:Joose.Managed.Property,apply:function(a){if(!a.meta.hasMethod(this.name)){throw"Requirement ["+this.name+"], defined in ["+this.definedIn.definedIn.name+"] is not satisfied for class ["+a+"]"}},unapply:function(a){}}).c;Joose.Managed.Property.Attribute=new Joose.Proto.Class("Joose.Managed.Property.Attribute",{isa:Joose.Managed.Property,slot:null,initialize:function(){Joose.Managed.Property.Attribute.superClass.initialize.apply(this,arguments);this.slot=this.name},apply:function(a){a.prototype[this.slot]=this.value},isAppliedTo:function(a){return a.prototype[this.slot]==this.value},unapply:function(a){if(!this.isAppliedTo(a)){throw"Unapply of property ["+this.name+"] from ["+a+"] failed"}delete a.prototype[this.slot]},getRawValueFrom:function(a){return a[this.slot]},setRawValueTo:function(a,b){a[this.slot]=b}}).c;Joose.Managed.Property.MethodModifier=new Joose.Proto.Class("Joose.Managed.Property.MethodModifier",{isa:Joose.Managed.Property,prepareWrapper:function(){throw"Abstract method [prepareWrapper] of "+this+" was called"},apply:function(i){var a=this.name;var f=i.prototype;var h=f.hasOwnProperty(a);var c=f[a];var b=i.meta.superClass.prototype;var d=h?c:function(){return b[a].apply(this,arguments)};var g=this.prepareWrapper({name:a,modifier:this.value,isOwn:h,originalCall:d,superProto:b,target:i});if(h){g._original=c}g._contain=this.value;f[a]=g},isAppliedTo:function(b){var a=b.prototype[this.name];return a&&a._contain==this.value},unapply:function(d){var a=this.name;var c=d.prototype;var b=c[a]._original;if(!this.isAppliedTo(d)){throw"Unapply of method ["+a+"] from class ["+d+"] failed"}if(b){c[a]=b}else{delete c[a]}}}).c;Joose.Managed.Property.MethodModifier.Override=new Joose.Proto.Class("Joose.Managed.Property.MethodModifier.Override",{isa:Joose.Managed.Property.MethodModifier,prepareWrapper:function(i){var a=i.modifier;var h=i.originalCall;var g=i.superProto;var c=g.meta.constructor;var b=(c==Joose.Proto.Class||c==Joose.Proto.Object)&&!(i.isOwn&&h.IS_OVERRIDE);var f=h;if(b){f=function(){var j=this.SUPER;this.SUPER=g.SUPER;var k=h.apply(this,arguments);this.SUPER=j;return k}}var d=function(){var j=this.SUPER;this.SUPER=f;var k=a.apply(this,arguments);this.SUPER=j;return k};d.IS_OVERRIDE=true;return d}}).c;Joose.Managed.Property.MethodModifier.Put=new Joose.Proto.Class("Joose.Managed.Property.MethodModifier.Put",{isa:Joose.Managed.Property.MethodModifier.Override,prepareWrapper:function(a){if(a.isOwn){throw"Method ["+a.name+"] is applying over something ["+a.originalCall+"] in class ["+a.target+"]"}return Joose.Managed.Property.MethodModifier.Put.superClass.prepareWrapper.call(this,a)}}).c;Joose.Managed.Property.MethodModifier.After=new Joose.Proto.Class("Joose.Managed.Property.MethodModifier.After",{isa:Joose.Managed.Property.MethodModifier,prepareWrapper:function(c){var a=c.modifier;var b=c.originalCall;return function(){var d=b.apply(this,arguments);a.apply(this,arguments);return d}}}).c;Joose.Managed.Property.MethodModifier.Before=new Joose.Proto.Class("Joose.Managed.Property.MethodModifier.Before",{isa:Joose.Managed.Property.MethodModifier,prepareWrapper:function(c){var a=c.modifier;var b=c.originalCall;return function(){a.apply(this,arguments);return b.apply(this,arguments)}}}).c;Joose.Managed.Property.MethodModifier.Around=new Joose.Proto.Class("Joose.Managed.Property.MethodModifier.Around",{isa:Joose.Managed.Property.MethodModifier,prepareWrapper:function(f){var a=f.modifier;var c=f.originalCall;var d;var b=function(){return c.apply(d,arguments)};return function(){d=this;var g=[b];g.push.apply(g,arguments);return a.apply(this,g)}}}).c;Joose.Managed.Property.MethodModifier.Augment=new Joose.Proto.Class("Joose.Managed.Property.MethodModifier.Augment",{isa:Joose.Managed.Property.MethodModifier,prepareWrapper:function(b){var a=function(){var g=[];var c=a;do{g.push(c.IS_AUGMENT?c._contain:c);c=c.IS_AUGMENT&&(c._original||c.SUPER[c.methodName])}while(c);var f=this.INNER;this.INNER=function(){var h=g.pop();return h?h.apply(this,arguments):undefined};var d=this.INNER.apply(this,arguments);this.INNER=f;return d};a.methodName=b.name;a.SUPER=b.superProto;a.IS_AUGMENT=true;return a}}).c;Joose.Managed.PropertySet=new Joose.Proto.Class("Joose.Managed.PropertySet",{isa:Joose.Managed.Property,properties:null,propertyMetaClass:Joose.Managed.Property,initialize:function(a){Joose.Managed.PropertySet.superClass.initialize.call(this,a);this.properties=a.properties||{}},addProperty:function(b,c){var a=c.meta||this.propertyMetaClass;delete c.meta;c.definedIn=this;c.name=b;return this.properties[b]=new a(c)},addPropertyObject:function(a){return this.properties[a.name]=a},removeProperty:function(a){var b=this.properties[a];delete this.properties[a];return b},haveProperty:function(a){return this.properties[a]!=null},haveOwnProperty:function(a){return this.haveProperty(a)&&this.properties.hasOwnProperty(a)},getProperty:function(a){return this.properties[a]},each:function(b,a){a=a||this;Joose.O.each(this.properties,function(d,c){b.call(a,d,c)})},eachOwn:function(b,a){a=a||this;Joose.O.eachOwn(this.properties,function(d,c){b.call(a,d,c)})},eachAll:function(b,a){this.each(b,a)},cloneProps:function(){var a=Joose.Managed.PropertySet.superClass.cloneProps.call(this);a.propertyMetaClass=this.propertyMetaClass;return a},clone:function(a){var b=this.cleanClone(a);b.properties=Joose.O.copyOwn(this.properties);return b},cleanClone:function(a){var b=this.cloneProps();b.name=a||b.name;return new this.constructor(b)},alias:function(b){var a=this.properties;Joose.O.each(b,function(d,c){var f=a[c];if(f){this.addPropertyObject(f.clone(d))}},this)},exclude:function(b){var a=this.properties;Joose.A.each(b,function(c){delete a[c]})},flattenTo:function(b){var a=b.properties;this.eachOwn(function(f,d){var c=a[d];if(c instanceof Joose.Managed.Property.ConflictMarker){return}if(c==null){b.addPropertyObject(f);return}if(c==f){return}b.removeProperty(d);b.addProperty(d,{meta:Joose.Managed.Property.ConflictMarker})},this)},composeTo:function(a){this.eachOwn(function(c,b){if(!a.haveOwnProperty(b)){a.addPropertyObject(c)}})},composeFrom:function(){if(!arguments.length){return}var a=this.cleanClone();Joose.A.each(arguments,function(b){var c=b;if(!(b instanceof Joose.Managed.PropertySet)){c=b.propertySet;if(b.alias||b.exclude){c=c.clone()}if(b.alias){c.alias(b.alias)}if(b.exclude){c.exclude(b.exclude)}}c.flattenTo(a)});a.composeTo(this)},preApply:function(a){this.eachOwn(function(b){b.preApply(a)})},apply:function(a){this.eachOwn(function(b){b.apply(a)})},unapply:function(a){this.eachOwn(function(b){b.unapply(a)})},postUnApply:function(a){this.eachOwn(function(b){b.postUnApply(a)})}}).c;(function(){var a=1;Joose.Managed.PropertySet.Mutable=new Joose.Proto.Class("Joose.Managed.PropertySet.Mutable",{isa:Joose.Managed.PropertySet,ID:null,derivatives:null,opened:null,composedFrom:null,initialize:function(b){Joose.Managed.PropertySet.Mutable.superClass.initialize.call(this,b);this.opened=1;this.derivatives={};this.ID=a++;this.composedFrom=[]},setComposeInfo:function(){this.ensureOpen();Joose.A.each(this.composedFrom,function(b){var c=b instanceof Joose.Managed.PropertySet?b:b.propertySet;delete c.derivatives[this.ID]},this);this.composedFrom=[];this.addComposeInfo.apply(this,arguments)},addComposeInfo:function(){this.ensureOpen();Joose.A.each(arguments,function(b){this.composedFrom.push(b);var c=b instanceof Joose.Managed.PropertySet?b:b.propertySet;c.derivatives[this.ID]=this},this)},removeComposeInfo:function(){this.ensureOpen();Joose.A.each(arguments,function(b){var d=0;while(d<this.composedFrom.length){var c=this.composedFrom[d];c=c instanceof Joose.Managed.PropertySet?c:c.propertySet;if(b==c){delete c.derivatives[this.ID];this.composedFrom.splice(d,1)}else{d++}}},this)},ensureOpen:function(){if(!this.opened){throw"Mutation of closed property set: ["+this.name+"]"}},addProperty:function(b,c){this.ensureOpen();return Joose.Managed.PropertySet.Mutable.superClass.addProperty.call(this,b,c)},addPropertyObject:function(b){this.ensureOpen();return Joose.Managed.PropertySet.Mutable.superClass.addPropertyObject.call(this,b)},removeProperty:function(b){this.ensureOpen();return Joose.Managed.PropertySet.Mutable.superClass.removeProperty.call(this,b)},composeFrom:function(){this.ensureOpen();return Joose.Managed.PropertySet.Mutable.superClass.composeFrom.apply(this,this.composedFrom)},open:function(){this.opened++;if(this.opened==1){Joose.O.each(this.derivatives,function(b){b.open()});this.deCompose()}},close:function(){if(!this.opened){throw"Unmatched 'close' operation on property set: ["+this.name+"]"}if(this.opened==1){this.reCompose();Joose.O.each(this.derivatives,function(b){b.close()})}this.opened--},reCompose:function(){this.composeFrom()},deCompose:function(){this.eachOwn(function(c,b){if(c.definedIn!=this){this.removeProperty(b)}},this)}}).c})();Joose.Managed.StemElement=function(){throw"Modules may not be instantiated."};Joose.Managed.StemElement.Attributes=new Joose.Proto.Class("Joose.Managed.StemElement.Attributes",{isa:Joose.Managed.PropertySet.Mutable,propertyMetaClass:Joose.Managed.Property.Attribute}).c;Joose.Managed.StemElement.Methods=new Joose.Proto.Class("Joose.Managed.StemElement.Methods",{isa:Joose.Managed.PropertySet.Mutable,propertyMetaClass:Joose.Managed.Property.MethodModifier.Put,preApply:function(){},postUnApply:function(){}}).c;Joose.Managed.StemElement.Requirements=new Joose.Proto.Class("Joose.Managed.StemElement.Requirements",{isa:Joose.Managed.PropertySet.Mutable,propertyMetaClass:Joose.Managed.Property.Requirement,alias:function(){},exclude:function(){},flattenTo:function(a){this.each(function(c,b){if(!a.haveProperty(b)){a.addPropertyObject(c)}})},composeTo:function(a){this.flattenTo(a)},preApply:function(a){},postUnApply:function(){}}).c;Joose.Managed.StemElement.MethodModifiers=new Joose.Proto.Class("Joose.Managed.StemElement.MethodModifiers",{isa:Joose.Managed.PropertySet.Mutable,propertyMetaClass:null,addProperty:function(c,d){var b=d.meta;delete d.meta;d.definedIn=this;d.name=c;var a=new b(d);if(!this.properties[c]){this.properties[c]=[]}this.properties[c].push(a);return a},addPropertyObject:function(b){var a=b.name;if(!this.properties[a]){this.properties[a]=[]}this.properties[a].push(b);return b},removeProperty:function(b){if(!this.haveProperty(b)){return undefined}var a=this.properties[b].pop();if(!this.properties[b].length){Joose.Managed.StemElement.MethodModifiers.superClass.removeProperty.call(this,b)}return a},alias:function(){},exclude:function(){},flattenTo:function(b){var a=b.properties;this.each(function(c,d){var f=a[d];if(f==null){f=a[d]=[]}Joose.A.each(c,function(g){if(!Joose.A.exists(f,g)){f.push(g)}})},this)},composeTo:function(a){this.flattenTo(a)},deCompose:function(){this.each(function(a,b){var c=0;while(c<a.length){if(a[c].definedIn!=this){a.splice(c,1)}else{c++}}},this)},preApply:function(a){},postUnApply:function(a){},apply:function(a){this.each(function(b,c){Joose.A.each(b,function(d){d.apply(a)})})},unapply:function(a){this.each(function(b,c){for(var d=b.length-1;d>=0;d--){b[d].unapply(a)}})}}).c;Joose.Managed.PropertySet.Composition=new Joose.Proto.Class("Joose.Managed.PropertySet.Composition",{isa:Joose.Managed.PropertySet.Mutable,propertyMetaClass:Joose.Managed.PropertySet.Mutable,processOrder:null,each:function(c,b){var a=this.properties;Joose.A.each(this.processOrder,function(d){c.call(b||this,a[d],d)},this)},eachR:function(d,c){var b=this.properties;for(var a=this.processOrder.length-1;a>=0;a--){d.call(c||this,b[this.processOrder[a]],this.processOrder[a])}},clone:function(a){var b=this.cleanClone(a);this.each(function(c){b.addPropertyObject(c.clone())});return b},alias:function(a){this.each(function(b){b.alias(a)})},exclude:function(a){this.each(function(b){b.exclude(a)})},flattenTo:function(b){var a=b.properties;this.each(function(f,c){var d=a[c]||b.addProperty(c,{meta:f.constructor});f.flattenTo(d)})},composeTo:function(b){var a=b.properties;this.each(function(f,c){var d=a[c]||b.addProperty(c,{meta:f.constructor});f.composeTo(d)})},deCompose:function(){this.eachR(function(a){a.open()});Joose.Managed.PropertySet.Composition.superClass.deCompose.call(this)},reCompose:function(){Joose.Managed.PropertySet.Composition.superClass.reCompose.call(this);this.each(function(a){a.close()})},unapply:function(a){this.eachR(function(b){b.unapply(a)})}}).c;Joose.Managed.Stem=new Joose.Proto.Class("Joose.Managed.Stem",{isa:Joose.Managed.PropertySet.Composition,targetMeta:null,attributesMC:Joose.Managed.StemElement.Attributes,methodsMC:Joose.Managed.StemElement.Methods,requirementsMC:Joose.Managed.StemElement.Requirements,methodsModifiersMC:Joose.Managed.StemElement.MethodModifiers,processOrder:["attributes","methods","requirements","methodsModifiers"],initialize:function(a){Joose.Managed.Stem.superClass.initialize.call(this,a);var b=this.targetMeta;this.addProperty("attributes",{meta:this.attributesMC,properties:b?b.attributes:{}});this.addProperty("methods",{meta:this.methodsMC,properties:b?b.methods:{}});this.addProperty("requirements",{meta:this.requirementsMC});this.addProperty("methodsModifiers",{meta:this.methodsModifiersMC})},reCompose:function(){this.preApply(this.targetMeta.c);Joose.Managed.Stem.superClass.reCompose.call(this);this.apply(this.targetMeta.c)},deCompose:function(){this.unapply(this.targetMeta.c);Joose.Managed.Stem.superClass.deCompose.call(this);this.postUnApply(this.targetMeta.c)}}).c;Joose.Managed.Builder=new Joose.Proto.Class("Joose.Managed.Builder",{targetMeta:null,_buildStart:function(b,a){b.stem.open();Joose.A.each(["trait","traits","removeTrait","removeTraits","does","doesnot","doesnt"],function(c){if(a[c]){this[c](b,a[c]);delete a[c]}},this)},_extend:function(a){if(Joose.O.isEmpty(a)){return}var b=this.targetMeta;this._buildStart(b,a);Joose.O.eachOwn(a,function(f,c){var d=this[c];if(!d){throw"Unknow builder ["+c+"] was used during extending of ["+b.c+"]"}d.call(this,b,f)},this);this._buildComplete(b,a)},_buildComplete:function(b,a){b.stem.close()},methods:function(b,a){Joose.O.eachOwn(a,function(d,c){b.addMethod(c,d)},this)},removeMethods:function(b,a){Joose.A.each(a,function(c){b.removeMethod(c)},this)},have:function(b,a){Joose.O.eachOwn(a,function(d,c){b.addAttribute(c,d)},this)},havenot:function(b,a){Joose.A.each(a,function(c){b.removeAttribute(c)},this)},havent:function(b,a){this.havenot(b,a)},after:function(b,a){Joose.O.each(a,function(d,c){b.addMethodModifier(c,d,Joose.Managed.Property.MethodModifier.After)},this)},before:function(b,a){Joose.O.each(a,function(d,c){b.addMethodModifier(c,d,Joose.Managed.Property.MethodModifier.Before)},this)},override:function(b,a){Joose.O.each(a,function(d,c){b.addMethodModifier(c,d,Joose.Managed.Property.MethodModifier.Override)},this)},around:function(b,a){Joose.O.each(a,function(d,c){b.addMethodModifier(c,d,Joose.Managed.Property.MethodModifier.Around)},this)},augment:function(b,a){Joose.O.each(a,function(d,c){b.addMethodModifier(c,d,Joose.Managed.Property.MethodModifier.Augment)},this)},removeModifier:function(b,a){Joose.A.each(a,function(c){b.removeMethodModifier(c)},this)},does:function(b,a){Joose.A.each(Joose.O.wantArray(a),function(c){b.addRole(c)},this)},doesnot:function(b,a){Joose.A.each(Joose.O.wantArray(a),function(c){b.removeRole(c)},this)},doesnt:function(b,a){this.doesnot(b,a)},trait:function(){this.traits.apply(this,arguments)},traits:function(b,a){if(b.firstPass){return}if(!b.meta.isDetached){throw"Can't apply trait to not detached class"}b.meta.extend({does:a})},removeTrait:function(){this.removeTraits.apply(this,arguments)},removeTraits:function(b,a){if(!b.meta.isDetached){throw"Can't remove trait from not detached class"}b.meta.extend({doesnot:a})}}).c;Joose.Managed.Class=new Joose.Proto.Class("Joose.Managed.Class",{isa:Joose.Proto.Class,stem:null,stemClass:Joose.Managed.Stem,stemClassCreated:false,builder:null,builderClass:Joose.Managed.Builder,builderClassCreated:false,isDetached:false,firstPass:true,skipTraitsAnchor:{},BUILD:function(){var a=Joose.Managed.Class.superClass.BUILD.apply(this,arguments);var b=a.__extend__;var c=Joose.O.wantArray(b.trait||b.traits||[]);delete b.trait;delete b.traits;Joose.A.each(Joose.O.wantArray(b.does||[]),function(d){var f=(d.meta instanceof Joose.Managed.Class)?d:d.role;if(f.meta.meta.isDetached){c.push(f.meta.constructor)}});if(c.length){b.traits=c}return a},initInstance:function(a,b){Joose.O.each(this.attributes,function(d,c){if(d instanceof Joose.Managed.Attribute){d.initFromConfig(a,b)}else{if(b.hasOwnProperty(c)){a[c]=b[c]}}})},defaultConstructor:function(){return function(b,d){var a=this.meta;var g=b==a.skipTraitsAnchor;var i=this.BUILD.apply(this,g?d:arguments);var h=i.__extend__||i;var j=h.trait||h.traits;if(j||h.detached){delete h.trait;delete h.traits;delete h.detached;if(!g){var c=a.subClassOf(this.constructor,{does:j||[]});var k=c.meta;k.isDetached=true;k.name=a.name;return k.instantiate.call(k,a.skipTraitsAnchor,arguments)}}a.initInstance(this,i);var f=this.initialize;if(typeof f=="function"){f.call(this,i)}}},finalize:function(a){Joose.Managed.Class.superClass.finalize.call(this,a);this.stem.close();this.afterMutate()},processStem:function(){Joose.Managed.Class.superClass.processStem.call(this);this.builder=new this.builderClass({targetMeta:this});this.stem=new this.stemClass({name:this.name,targetMeta:this});var b=this.getClassInAttribute("builderClass");if(b){this.builderClassCreated=true;this.addAttribute("builderClass",this.subClassOf(b))}var a=this.getClassInAttribute("stemClass");if(a){this.stemClassCreated=true;this.addAttribute("stemClass",this.subClassOf(a))}},extend:function(a){if(a.builder){this.getBuilderTarget().meta.extend(a.builder);delete a.builder}if(a.stem){this.getStemTarget().meta.extend(a.stem);delete a.stem}this.builder._extend(a);this.firstPass=false;if(!this.stem.opened){this.afterMutate()}},getBuilderTarget:function(){var a=this.getClassInAttribute("builderClass");if(!a){throw"Attempt to extend a builder on non-meta class"}return a},getStemTarget:function(){var a=this.getClassInAttribute("stemClass");if(!a){throw"Attempt to extend a stem on non-meta class"}return a},getClassInAttribute:function(a){var b=this.getAttribute(a);if(b instanceof Joose.Managed.Property.Attribute){b=b.value}return b},addMethodModifier:function(a,d,c){var b={};b.init=d;b.meta=c;return this.stem.properties.methodsModifiers.addProperty(a,b)},removeMethodModifier:function(a){return this.stem.properties.methodsModifiers.removeProperty(a)},addMethod:function(a,c,b){b=b||{};b.init=c;return this.stem.properties.methods.addProperty(a,b)},addAttribute:function(a,c,b){b=b||{};b.init=c;return this.stem.properties.attributes.addProperty(a,b)},removeMethod:function(a){return this.stem.properties.methods.removeProperty(a)},removeAttribute:function(a){return this.stem.properties.attributes.removeProperty(a)},hasMethod:function(a){return this.stem.properties.methods.haveProperty(a)},hasAttribute:function(a){return this.stem.properties.attributes.haveProperty(a)},hasOwnMethod:function(a){return this.stem.properties.methods.haveOwnProperty(a)},hasOwnAttribute:function(a){return this.stem.properties.attributes.haveOwnProperty(a)},getMethod:function(a){return this.stem.properties.methods.getProperty(a)},getAttribute:function(a){return this.stem.properties.attributes.getProperty(a)},eachRole:function(b,c,a){Joose.A.each(b,function(d,f){var g=(d.meta instanceof Joose.Managed.Class)?d:d.role;c.call(a||this,d,g,f)},this)},addRole:function(){this.eachRole(arguments,function(a,c){this.beforeRoleAdd(c);var b=a;if(c!=a){b.propertySet=c.meta.stem;delete b.role}else{b=b.meta.stem}this.stem.addComposeInfo(b)},this)},beforeRoleAdd:function(b){var a=b.meta;if(a.builderClassCreated){this.getBuilderTarget().meta.extend({does:[a.getBuilderTarget()]})}if(a.stemClassCreated){this.getStemTarget().meta.extend({does:[a.getStemTarget()]})}if(a.meta.isDetached&&!this.firstPass){this.builder.traits(this,a.constructor)}},beforeRoleRemove:function(b){var a=b.meta;if(a.builderClassCreated){this.getBuilderTarget().meta.extend({doesnt:[a.getBuilderTarget()]})}if(a.stemClassCreated){this.getStemTarget().meta.extend({doesnt:[a.getStemTarget()]})}if(a.meta.isDetached&&!this.firstPass){this.builder.removeTraits(this,a.constructor)}},removeRole:function(){this.eachRole(arguments,function(a,b){this.beforeRoleRemove(b);this.stem.removeComposeInfo(b.meta.stem)},this)},getRoles:function(){var a=[];Joose.A.each(this.stem.composedFrom,function(b){if(!(b instanceof Joose.Managed.PropertySet)){b=b.propertySet}a.push(b.targetMeta.c)});return a},does:function(d){var b=this.getRoles();for(var c=0;c<b.length;c++){if(d==b[c]){return true}}for(var c=0;c<b.length;c++){if(b[c].meta.does(d)){return true}}var a=this.superClass.meta;if(this.superClass!=Joose.Proto.Empty&&a&&a.meta&&a.meta.hasMethod("does")){return a.does(d)}return false},getMethods:function(){return this.stem.properties.methods},getAttributes:function(){return this.stem.properties.attributes},afterMutate:function(){}}).c;Joose.Managed.Role=new Joose.Managed.Class("Joose.Managed.Role",{isa:Joose.Managed.Class,have:{defaultSuperClass:Joose.Proto.Empty,builderRole:null,stemRole:null},methods:{defaultConstructor:function(){return function(){throw"Roles cant be instantiated"}},processSuperClass:function(){if(this.superClass!=this.defaultSuperClass){throw"Roles can't inherit from anything"}},getBuilderTarget:function(){if(!this.builderRole){this.builderRole=new this.constructor().c;this.builderClassCreated=true}return this.builderRole},getStemTarget:function(){if(!this.stemRole){this.stemRole=new this.constructor().c;this.stemClassCreated=true}return this.stemRole},addRequirement:function(a){this.stem.properties.requirements.addProperty(a,{})}},stem:{methods:{apply:function(){},unapply:function(){}}},builder:{methods:{requires:function(a,b){Joose.A.each(Joose.O.wantArray(b),function(c){a.addRequirement(c)},this)}}}}).c;Joose.Managed.Attribute=new Joose.Managed.Class("Joose.Managed.Attribute",{isa:Joose.Managed.Property.Attribute,have:{is:null,builder:null,isPrivate:false,role:null,publicName:null,setterName:null,getterName:null,readable:false,writeable:false,hasGetter:false,hasSetter:false,required:false},after:{initialize:function(){var a=this.name;this.publicName=a.replace(/^_+/,"");this.slot=this.isPrivate?"$$"+a:a;this.setterName=this.setterName||this.getSetterName();this.getterName=this.getterName||this.getGetterName();this.readable=this.hasGetter=/^r/i.test(this.is);this.writeable=this.hasSetter=/^.w/i.test(this.is)}},override:{computeValue:function(){if(!Joose.O.isFunction(this.init)){this.SUPER()}},preApply:function(a){a.meta.extend({methods:this.getAccessorsFor(a)})},postUnApply:function(a){a.meta.extend({removeMethods:this.getAccessorsFrom(a)})}},methods:{getAccessorsFor:function(d){var f=d.meta;var b=this.setterName;var c=this.getterName;var a={};if(this.hasSetter&&!f.hasMethod(b)){a[b]=this.getSetter();a[b].ACCESSOR_FROM=this}if(this.hasGetter&&!f.hasMethod(c)){a[c]=this.getGetter();a[c].ACCESSOR_FROM=this}return a},getAccessorsFrom:function(h){var g=h.meta;var c=this.setterName;var d=this.getterName;var f=this.hasSetter&&g.getMethod(c);var b=this.hasGetter&&g.getMethod(d);var a=[];if(f&&f.value.ACCESSOR_FROM==this){a.push(c)}if(b&&b.value.ACCESSOR_FROM==this){a.push(d)}return a},getGetterName:function(){return"get"+Joose.S.uppercaseFirst(this.publicName)},getSetterName:function(){return"set"+Joose.S.uppercaseFirst(this.publicName)},getSetter:function(){var a=this.slot;return function(b){this[a]=b;return this}},getGetter:function(){var a=this.slot;return function(){return this[a]}},getValueFrom:function(a){var b=this.getterName;if(this.readable&&a.meta.hasMethod(b)){return a[b]()}return a[this.slot]},setValueTo:function(a,c){var b=this.setterName;if(this.writeable&&a.meta.hasMethod(b)){a[b](c)}else{a[this.slot]=c}},initFromConfig:function(a,c){var b=this.name;var f,d=false;if(c.hasOwnProperty(b)){f=c[b];d=true}else{if(Joose.O.isFunction(this.init)){f=this.init.call(a,b,c);d=true}else{if(this.builder){f=a[this.builder.replace(/^this\./,"")](b,c);d=true}}}if(d){this.setValueTo(a,f)}else{if(this.required){throw"Required attribute ["+b+"] is missed during initialization of "+a}}}}}).c;Joose.Managed.PropertySet.Namespace=new Joose.Proto.Class("Joose.Managed.PropertySet.Namespace",{isa:Joose.Managed.PropertySet,propertyMetaClass:null,targetMeta:null,container:null,initialize:function(a){Joose.Managed.PropertySet.Namespace.superClass.initialize.call(this,a);this.container=this.targetMeta.c},addProperty:function(a,b){if(b&&b.meta&&b.meta.meta.hasAttribute("ns")){b.meta.parentNs=this.targetMeta.ns}return this.container[a]=this.properties[a]=b},removeProperty:function(a){try{delete this.container[a]}catch(b){this.container[a]=undefined}return Joose.Managed.PropertySet.Namespace.superClass.removeProperty.call(this,a)}}).c;Joose.Managed.Attribute.Builder=new Joose.Managed.Role("Joose.Managed.Attribute.Builder",{have:{defaultAttributeClass:Joose.Managed.Attribute},builder:{methods:{has:function(a,b){Joose.O.eachOwn(b,function(d,c){if(typeof d!="object"||d==null||d.constructor==RegExp){d={init:d}}d.meta=d.meta||a.defaultAttributeClass;if(/^__/.test(c)){c=c.replace(/^_+/,"");d.isPrivate=true}a.addAttribute(c,d.init,d)},this)},hasnot:function(a,b){this.havenot(a,b)},hasnt:function(a,b){this.hasnot(a,b)}}}}).c;Joose.Managed.My=new Joose.Managed.Role("Joose.Managed.My",{have:{myClass:null,needToReAlias:false},methods:{createMy:function(f){var d=this.meta;var a=this instanceof Joose.Managed.Role;var b=f.my||{};delete f.my;if(!a){b.isa=b.isa||this.superClass.meta.myClass}if(!b.meta&&!b.isa){b.meta=this.constructor}var c=this.myClass=Class(b);this.c.prototype.my=this.c.my=a?c:new c({HOST:this.c});this.needToReAlias=true},aliasStaticMethods:function(){this.needToReAlias=false;var b=this.c;var a=this.myClass.prototype;this.myClass.meta.stem.properties.methods.each(function(f,c){var d=b[c];if(d&&d.IS_ALIAS){delete b[c]}if(!b[c]){(b[c]=function(){return a[c].apply(b.my,arguments)}).IS_ALIAS=true}})}},override:{extend:function(a){if(!this.myClass&&this.superClass.meta.myClass){this.createMy(a)}if(a.my){if(!this.myClass){this.createMy(a)}else{this.myClass.meta.extend(a.my);delete a.my}}this.SUPER(a);if(this.needToReAlias&&!(this instanceof Joose.Managed.Role)){this.aliasStaticMethods()}}},before:{addRole:function(){var a;Joose.A.each(arguments,function(b){var c=(b.meta instanceof Joose.Managed.Class)?b:b.role;if(c.meta.meta.hasAttribute("myClass")&&c.meta.myClass){if(!this.myClass){this.createMy({my:{does:c.meta.myClass}});return}a=this.myClass.meta.stem;if(!a.opened){a.open()}a.addComposeInfo(c.my.meta.stem)}},this);if(a){a.close();this.needToReAlias=true}},removeRole:function(){if(!this.myClass){return}var a=this.myClass.meta.stem;a.open();Joose.A.each(arguments,function(b){if(b.meta.meta.hasAttribute("myClass")&&b.meta.myClass){a.removeComposeInfo(b.my.meta.stem);this.needToReAlias=true}},this);a.close()}}}).c;Joose.Namespace=function(){throw"Modules may not be instantiated."};Joose.Namespace.Able=new Joose.Managed.Role("Joose.Namespace.Able",{have:{parentNs:null,ns:null,bodyFunc:null},before:{extend:function(a){if(a.body){this.bodyFunc=a.body;delete a.body}}},after:{adaptConstructor:function(b){var a=(this.name||"").split(".").pop();this.ns=new Joose.Managed.PropertySet.Namespace({name:a,targetMeta:this})},afterMutate:function(){var a=this.bodyFunc;delete this.bodyFunc;if(a){Joose.Namespace.Manager.my.executeIn(this.c,a)}}}}).c;Joose.Managed.Bootstrap=new Joose.Managed.Role("Joose.Managed.Bootstrap",{does:[Joose.Namespace.Able,Joose.Managed.My,Joose.Managed.Attribute.Builder]}).c;Joose.Meta=function(){throw"Modules may not be instantiated."};Joose.Meta.Object=new Joose.Proto.Class("Joose.Meta.Object",{isa:Joose.Proto.Object}).c;Joose.Meta.Class=new Joose.Managed.Class("Joose.Meta.Class",{isa:Joose.Managed.Class,does:Joose.Managed.Bootstrap,have:{defaultSuperClass:Joose.Meta.Object}}).c;Joose.Meta.Role=new Joose.Meta.Class("Joose.Meta.Role",{isa:Joose.Managed.Role,does:Joose.Managed.Bootstrap}).c;Joose.Namespace.Keeper=new Joose.Meta.Class("Joose.Namespace.Keeper",{isa:Joose.Meta.Class,have:{externalConstructor:null},methods:{defaultConstructor:function(){return function(){var b=arguments.callee.meta;if(b instanceof Joose.Namespace.Keeper){throw"Module ["+b.c+"] may not be instantiated."}var a=b.externalConstructor;if(typeof a=="function"){a.meta=b;return a.apply(this,arguments)}throw"NamespaceKeeper of ["+b.name+"] was planted incorrectly."}},plant:function(b){this.copyNamespaceState(b);var a=this.c;a.meta=b.meta;a.meta.c=a;a.meta.externalConstructor=b},copyNamespaceState:function(a){var b=a.meta;b.parentNs=this.parentNs;b.ns=this.ns}}}).c;Joose.Namespace.Manager=new Joose.Managed.Class("Joose.Namespace.Manager",{have:{global:null,globalNs:null,current:null},methods:{initialize:function(){var b=this.global=new Joose.Namespace.Keeper("").c;var a=this.globalNs=b.meta.ns;a.container=Joose.is_NodeJS&&global||Joose.top;b.meta.parentNs=b;this.current=[b]},getCurrent:function(){return this.current[0]},executeIn:function(c,d){var f=this.current;var b=c.meta.ns?c.meta.ns.container:c;f.unshift(c);var a=d.call(b,c);f.shift();return a},earlyCreate:function(b,a,c){c.constructorOnly=true;return new a(b,c).c},create:function(c,o,m){if(!c){return new o(c,m).c}var n=this;if(/^\./.test(c)){return this.executeIn(this.global,function(){return n.create(c.replace(/^\./,""),o,m)})}props=m||{};var g=Joose.S.saneSplit(c,".");var f=this.getCurrent();var k=Joose.S.saneSplit(f.meta.name,".");for(var j=0;j<g.length;j++){var b=g[j];var h=j==g.length-1;if(b=="meta"||b=="my"||!b){throw"Module name ["+c+"] may not include a part called 'meta' or 'my' or empty part."}var p=(f==this.global?this.global.meta.ns.container:f)[b];k.push(b);var a=k.join(".");var d=false;var l;if(typeof p=="undefined"){if(h){l=this.earlyCreate(a,o,props);d=true}else{l=new Joose.Namespace.Keeper(a).c}if(f.meta){f.meta.ns.addProperty(b,l)}else{f[b]=l}p=l}else{if(h&&p&&p.meta){if(p.meta.constructor==o&&m){p.meta.extend(props)}else{if(p.meta instanceof Joose.Namespace.Keeper&&o!=Joose.Namespace.Keeper){p.meta.plant(this.earlyCreate(a,o,props));d=true}else{if(o!=Joose.Namespace.Keeper){throw"Re-declaration of class "+a+"with different meta is not allowed"}}}}else{if(h&&!(p&&p.meta&&p.meta.meta&&p.meta.meta.hasAttribute("ns"))){throw"Trying to setup module "+a+" failed. There is already something: "+p}}}if(d){p.meta.construct(props)}f=p}return f},prepareProperties:function(b,c,a,f){if(b&&typeof b!="string"){c=b;b=null}var d;if(c&&c.meta){d=c.meta;delete c.meta}if(!d){if(c&&typeof c.isa=="function"){d=c.isa.meta.constructor}else{d=a}}return f.call(this,b,d,c)},getDefaultHelperFor:function(a){var b=this;return function(c,d){return b.prepareProperties(c,d,a,function(f,h,g){return b.create(f,h,g)})}},register:function(g,a,f){var d=this;if(this.meta.hasMethod(g)){var c=function(){return d[g].apply(d,arguments)};if(!Joose.top[g]){Joose.top[g]=c}if(!Joose[g]){Joose[g]=c}if(Joose.is_NodeJS&&!global[g]){global[g]=c}}else{var b={};b[g]=f||this.getDefaultHelperFor(a);this.meta.extend({methods:b});this.register(g)}},Module:function(a,b){return this.prepareProperties(a,b,Joose.Namespace.Keeper,function(c,f,d){if(typeof d=="function"){d={body:d}}return this.create(c,f,d)})}}}).c;Joose.Namespace.Manager.my=new Joose.Namespace.Manager();Joose.Namespace.Manager.my.register("Class",Joose.Meta.Class);Joose.Namespace.Manager.my.register("Role",Joose.Meta.Role);Joose.Namespace.Manager.my.register("Module");Role("JooseX.Attribute.Trigger",{have:{trigger:null},after:{initialize:function(){if(this.trigger){this.writeable=this.hasSetter=true}}},override:{getSetter:function(){var b=this.SUPER();var a=this.trigger;if(!a){return b}var c=this;return function(){var d=b.apply(this,arguments);a.call(this,c.getValueFrom(this));return d}}}});Role("JooseX.Attribute.Lazy",{have:{lazy:null},before:{computeValue:function(){if(typeof this.init=="function"&&this.lazy){this.lazy=this.init;delete this.init}}},after:{initialize:function(){if(this.lazy){this.readable=this.hasGetter=true}}},override:{getGetter:function(){var b=this.SUPER();var a=this.lazy;if(!a){return b}var c=this;var d=this.slot;return function(){if(!this.hasOwnProperty(d)){var f=typeof a=="function"?a:this[a.replace(/^this\./,"")];var g=f.call(this,c);c.setValueTo(this,g)}return b.call(this)}},getSetter:function(){var c=this.SUPER();var b=this.lazy;if(!b){return c}var a=this.name;return function(){return c.apply(this,arguments)}},getRawValueFrom:function(a){var b=this.SUPER(a);if(!this.lazy){return b}return{predicate:a.hasOwnProperty(this.slot),value:b}},setRawValueTo:function(a,b){if(!this.lazy){return this.SUPERARG(arguments)}if(!b.predicate){delete a[this.slot]}else{this.SUPER(a,b.value)}}}});Role("JooseX.Attribute.Accessor.Combined",{have:{isCombined:false},after:{initialize:function(){this.isCombined=this.isCombined||/..c/i.test(this.is);if(this.isCombined){this.slot="$$"+this.name;this.hasGetter=true;this.hasSetter=false;this.setterName=this.getterName=this.publicName}}},override:{getGetter:function(){var a=this.SUPER();var c=this.getSetter();var b=this;return function(){if(!arguments.length){if(b.readable){return a.call(this)}throw"Call to getter of unreadable attribute: ["+b.name+"]"}if(b.writeable){return c.apply(this,arguments)}throw"Call to setter of read-only attribute: ["+b.name+"]"}}}});Joose.Managed.Attribute.meta.extend({does:[JooseX.Attribute.Trigger,JooseX.Attribute.Lazy,JooseX.Attribute.Accessor.Combined]});Class("JooseX.Namespace.Depended.Manager",{my:{have:{containResources:["use","meta","isa","does","trait","traits"],INC:Joose.is_NodeJS?require.paths:["lib","/jsan"],disableCaching:true,resources:{},resourceTypes:{},ANONYMOUS_RESOURCE_COUNTER:0},methods:{getMyResource:function(b,a,c){var d=this.getResource({type:b,token:a});if(d.attachedTo&&d.attachedTo!=c){throw d+" is already attached to ["+d.attachedTo+"]"}d.attachedTo=c;d.loaded=true;d.loading=false;return d},getResource:function(h){var d,c,g;if(typeof h=="object"){d=h.type;c=h.token;g=h.version;delete h.version}else{if(typeof h=="string"){var b=/^(\w+):\/\/(.+)/.exec(h);if(!b){d="joose";c=h}else{d=b[1];c=b[2]}}}if(!c){c="__ANONYMOUS_RESOURCE__"+this.ANONYMOUS_RESOURCE_COUNTER++;h=undefined}var i=d+"://"+c;var f=this.resources[i];if(!f){var a=this.resourceTypes[d];if(!a){throw"Unknown resource type: ["+d+"]"}f=this.resources[i]=new a(typeof h=="object"?h:{token:c,type:d})}f.setRequiredVersion(g);return f},registerResourceClass:function(b,a){this.resourceTypes[b]=a},use:function(c,f,b){var a=Joose.Namespace.Manager.my;var d=a.global;Class({use:c,body:function(){if(f){a.executeIn(d,function(g){f.call(b||this,g)})}}})}}}});use=function(b,c,a){JooseX.Namespace.Depended.Manager.my.use(b,c,a)};Joose.I.FutureClass=function(className){return function(){return eval(className)}};Class("JooseX.Namespace.Depended.Resource",{has:{attachedTo:null,type:null,token:null,id:null,loading:false,loaded:false,ready:false,loadedFromURL:null,readyListeners:Joose.I.Array,dependencies:Joose.I.Object,onBeforeReady:{is:"rw",init:null},readyDelegated:false,version:{is:"rw",init:null},requiredVersion:{is:"rw",init:null}},after:{initialize:function(){if(!this.id){this.id=this.type+"://"+this.token}}},methods:{setOnBeforeReady:function(a){if(this.onBeforeReady){throw"Can't redefine 'onBeforeReady' for "+this}this.onBeforeReady=a},setVersion:function(a){if(!a){return}if(this.version){throw"Cant redefine version of "+this}var b=this.requiredVersion;if(b&&a<b){throw"Versions conflict on "+this+" required ["+b+"], got ["+a+"]"}this.version=a},setRequiredVersion:function(a){if(!a){return}var b=this.requiredVersion;if(!b||a>b){if(this.isLoaded()||this.loading){throw"Cant increase required version - "+this+" is already loaded"}else{this.requiredVersion=a}}},toString:function(){return"Resource: id=["+this.id+"], type=["+this.meta.name+"]"},addDescriptor:function(c){var b=JooseX.Namespace.Depended.Manager.my.getResource(c);if(this.dependencies[b.id]||b.ready){return}var a=this;b.readyListeners.push(function(){delete a.dependencies[b.id];a.checkReady()});this.dependencies[b.id]=b;this.ready=false},handleDependencies:function(){Joose.O.eachOwn(this.dependencies||{},function(a){a.handleLoad()});this.checkReady()},checkReady:function(){if(!Joose.O.isEmpty(this.dependencies)){return}if(this.onBeforeReady){if(!this.readyDelegated){this.readyDelegated=true;var a=this;this.onBeforeReady(function(){a.fireReady()},a)}}else{this.fireReady()}},fireReady:function(){var a=this;setTimeout(function(){a.ready=true;var b=a.readyListeners||[];a.readyListeners=[];Joose.A.each(b,function(c){c()})},0)},isLoaded:function(){return this.loaded||this.ready},handleLoad:function(){if(this.isLoaded()){this.checkReady();return}if(this.loading){return}this.loading=true;var d=Joose.O.wantArray(this.getUrls());var c=this;var b=function(g,f){c.loaded=true;c.loading=false;c.loadedFromURL=f;c.materialize(g,f);c.checkReady()};var a=function(f){if(!d.length){throw c+" not found"}c.load(d.shift(),b,a)};this.load(d.shift(),b,a)},getUrls:function(){throw"Abstract resource method 'getUrls' was called"},load:function(c,b,a){throw"Abstract resource method 'load' was called"},materialize:function(a){throw"Abstract resource method 'materialize' was called"}}});Role("JooseX.Namespace.Depended.Materialize.Eval",{requires:["handleLoad"],methods:{materialize:function(resourceBlob){eval.call(Joose.top,resourceBlob)}}});Class("JooseX.Namespace.Depended.Resource.JooseClass",{isa:JooseX.Namespace.Depended.Resource,methods:{getUrls:function(){var b=[];var a=this.token.split(".");Joose.A.each(JooseX.Namespace.Depended.Manager.my.INC,function(c){c=c.replace(/\/$/,"");b.push([c].concat(a).join("/")+".js"+(JooseX.Namespace.Depended.Manager.my.disableCaching?"?disableCaching="+new Date().getTime():""))});return b}},override:{addDescriptor:function(a){if(typeof a=="object"&&!a.token){Joose.O.eachOwn(a,function(b,c){this.addDescriptor({type:"joose",token:c,version:b})},this)}else{this.SUPER(a)}}}});JooseX.Namespace.Depended.Manager.my.registerResourceClass("joose",JooseX.Namespace.Depended.Resource.JooseClass);Class("JooseX.Namespace.Depended.Resource.NonJoose",{isa:JooseX.Namespace.Depended.Resource.JooseClass,have:{presence:null},after:{initialize:function(){var me=this;if(!this.presence){this.presence=function(){return eval(me.token)}}}},methods:{isLoaded:function(){var a=false;try{a=this.presence()}catch(b){}return a||this.SUPER()}}});JooseX.Namespace.Depended.Manager.my.registerResourceClass("nonjoose",JooseX.Namespace.Depended.Resource.NonJoose);Role("JooseX.Namespace.Depended.Transport.NodeJS",{requires:["handleLoad"],override:{load:function(d,c,b){var a=require("fs");a.readFile(d,function(f,g){if(f){b(f);return}c(g,d)})}}});Role("JooseX.Namespace.Depended.Materialize.NodeJS",{requires:["handleLoad"],methods:{materialize:function(b,a){process.binding("evals").Script.runInThisContext(b,a)}}});JooseX.Namespace.Depended.Resource.JooseClass.meta.extend({does:[JooseX.Namespace.Depended.Transport.NodeJS,JooseX.Namespace.Depended.Materialize.NodeJS]});JooseX.Namespace.Depended.Manager.my.disableCaching=false;Role("JooseX.Namespace.Depended",{meta:Joose.Managed.Role,requires:["prepareProperties"],have:{containResources:["use","meta","isa","does","trait","traits"]},override:{prepareProperties:function(b,i,a,h){if(b&&typeof b!="string"){i=b;b=null}i=i||{};var g=[];var f=i.my;Joose.A.each(this.containResources,function(j){this.collectDependencies(i[j],g);if(f&&f[j]){this.collectDependencies(f[j],g)}},this);this.alsoDependsFrom(i,g);var d=JooseX.Namespace.Depended.Manager.my.getResource({type:"joose",token:b});if(i.VERSION){d.setVersion(i.VERSION);delete i.VERSION}if(i.BEGIN){d.setOnBeforeReady(i.BEGIN);delete i.BEGIN}Joose.A.each(g,function(j){d.addDescriptor(j)});if(Joose.O.isEmpty(d.dependencies)){d.handleDependencies();this.inlineDependencies(i);return this.SUPER(b,i,a,h)}else{setTimeout(function(){d.handleDependencies()},0)}var c=this;d.readyListeners.unshift(function(){c.inlineDependencies(i);c.prepareProperties(b,i,a,h)});return this.create(b,Joose.Namespace.Keeper,{})},create:function(){var a=this.SUPERARG(arguments).meta;a.resource=a.resource||JooseX.Namespace.Depended.Manager.my.getMyResource("joose",a.name,a.c);return a.c}},methods:{alsoDependsFrom:function(b,a){},collectDependencies:function(b,a){Joose.A.each(Joose.O.wantArray(b),function(c){if(c&&typeof c!="function"){a.push(c)}})},inlineDependencies:function(b){this.inlineDeps(b);var a=b.my;if(a){this.inlineDeps(a)}},inlineDeps:function(extend){delete extend.use;Joose.A.each(this.containResources,function(propName){if(extend[propName]){var descriptors=[];Joose.A.each(Joose.O.wantArray(extend[propName]),function(descriptor,index){if(typeof descriptor=="function"){descriptors.push(descriptor)}else{if(typeof descriptor=="object"){if(descriptor.token){descriptors.push(eval(descriptor.token))}else{Joose.O.each(descriptor,function(version,name){descriptors.push(eval(name))})}}else{if(typeof descriptor=="string"){descriptors.push(eval(descriptor))}else{throw"Wrong dependency descriptor format: "+descriptor}}}});if(propName!="isa"&&propName!="meta"){extend[propName]=descriptors}else{if(descriptors.length>1){throw"Cant specify several super- or meta- classes"}else{extend[propName]=descriptors[0]}}}})}}});Joose.Namespace.Manager.meta.extend({does:JooseX.Namespace.Depended});Joose.Namespace.Keeper.meta.extend({after:{copyNamespaceState:function(a){a.meta.resource=this.resource}}});Class("JooseX.CPS.Continuation",{has:{parent:null,previous:null,statements:Joose.I.Array,type:"Sequential",entered:false,leaved:false,defaultScope:null,nextFunc:null,catchFunc:null,catchScope:null,finallyFunc:null,finallyScope:null},methods:{deriveChild:function(a){a=a||{};a.parent=this;return new this.constructor(a)},deriveSibling:function(a){a=a||{};a.parent=this.parent;a.previous=this;return new this.constructor(a)},getNextFunc:function(){return this.nextFunc||this.parent&&this.parent.getNextFunc()},getScope:function(){var a=this.previous||this.parent;return this.defaultScope||a&&a.getScope()||Joose.top},entry:function(){if(this.entered){throw"Can't re-enter the continuation + ["+this+"]"}this.entered=true;this["runCore"+this.type].apply(this,arguments)},runCoreSequential:function(){var c=this;var a=this.statements;if(a.length){var b=a.shift();var d=this.deriveChild({defaultScope:b.scope,nextFunc:function(){c.runCoreSequential.apply(c,arguments)}});this.run(b.func,b.scope,b.args||arguments,d)}else{this.leave.apply(this,arguments)}},runCoreParallel:function(){var c=arguments;var b=this.statements;var g=b.length;var f=this;var d=[];var a=0;Joose.A.each(b,function(i,h){f.deriveChild().TRY(i.func,i.scope,i.args||c).THEN(function(){a++;d[h]=arguments;this.CONT.CONTINUE()}).CATCH(function(){a++;d[h]=arguments;this.CONT.CONTINUE()}).FINALLY(function(){if(a==g){f.leave(d)}}).NOW()})},run:function(g,d,c,f){var i=Joose.top;var b=d.CONT;var a=i.__GLOBAL_CNT__;i.__GLOBAL_CNT__=d.CONT=f;try{if(g.apply(d,c)!==undefined){throw"ERROR: Value returned from continued function (use `CONTINUE(value)` instead)"}}catch(h){if(f.leaved){throw h}f.THROW(h)}finally{d.CONT=b;i.__GLOBAL_CNT__=a}},leave:function(){var c=arguments;var g=this.finallyFunc;if(g){delete this.finallyFunc;var d=this.finallyScope;var f=this;var b=this.deriveChild({defaultScope:d,nextFunc:function(){f.leave.apply(f,c)}});this.run(g,d,[],b);return}if(this.leaved){throw"Can't re-leave the continuation + ["+this+"]"}this.leaved=true;var a=this.getNextFunc();if(a){a.apply(Joose.top,c)}},THROW:function(b){var a=arguments;var f=this.catchFunc;if(f){delete this.catchFunc;var d=this.catchScope;var g=this;var h=this.deriveChild({defaultScope:d,nextFunc:function(){g.leave.apply(g,arguments)}});this.run(f,d,a,h);return}var c=this.parent;if(c){this.nextFunc=function(){c.THROW.apply(c,a)};this.leave();return}throw b},CONTINUE:function(){return this.leave.apply(this,arguments)},RETURN:function(){if(this.parent){this.nextFunc=this.parent.getNextFunc()}return this.leave.apply(this,arguments)},TRY:function(c,b,a){if(this.leaved){throw"Can't call 'TRY' for ["+this+"] - its already leaved"}if(!c){throw"Invalid parameters for 'TRY' in ["+this+"]"}if(this.catchFunc||this.finallyFunc){return this.NEXT.apply(this,arguments)}this.statements.push({func:c,scope:b||this.getScope(),args:a});this.defaultScope=b||this.defaultScope;return this},THEN:function(){if(this.type=="Parallel"){return this.NEXT.apply(this,arguments)}return this.TRY.apply(this,arguments)},CATCH:function(b,a){if(this.leaved){throw"Can't call 'CATCH' for ["+this+"] - its already leaved"}if(!b){throw"Invalid parameters for 'CATCH' in ["+this+"]"}if(this.catchFunc){throw"Can't redefine 'CATCH' for ["+this+"]"}this.catchFunc=b;this.catchScope=a||this.getScope();return this},FINALLY:function(b,a){if(this.leaved){throw"Can't call 'FINALLY' for ["+this+"] - its already leaved"}if(!b){throw"Invalid parameters for 'FINALLY' in ["+this+"]"}if(this.finallyFunc){throw"Can't redefine 'FINALLY' for ["+this+"]"}this.finallyFunc=b;this.finallyScope=a||this.getScope();return this},NEXT:function(d,c,a){if(this.leaved){throw"Can't call 'NEXT' for ["+this+"] - its already leaved"}var b=this.deriveSibling();this.nextFunc=function(){b.entry.apply(b,arguments)};return b.TRY(d,c,a)},AND:function(){this.type="Parallel";return this.TRY.apply(this,arguments)},NOW:function(){var a=this.getNearestNotEntered();if(!a){throw"Can't launch ["+this+"]"}a.entry.apply(a,arguments)},getNearestNotEntered:function(){if(this.entered){return null}var b=this.previous||this.parent;if(b){var a=b.getNearestNotEntered();if(a){return a}}return this},getCONTINUE:function(){var a=this;return function(){a.CONTINUE.apply(a,arguments)}},getRETURN:function(){var a=this;return function(){a.RETURN.apply(a,arguments)}},getTHROW:function(){var a=this;return function(){a.THROW.apply(a,arguments)}},and:function(){return this.AND.apply(this,arguments)},then:function(){return this.THEN.apply(this,arguments)},next:function(){return this.NEXT.apply(this,arguments)},now:function(){return this.NOW.apply(this,arguments)},except:function(){return this.CATCH.apply(this,arguments)},ensure:function(){return this.FINALLY.apply(this,arguments)}}});TRY=function(){var a=new JooseX.CPS.Continuation();return a.TRY.apply(a,arguments)};Class("JooseX.CPS.MethodModifier.Override",{meta:Joose.Meta.Class,isa:Joose.Managed.Property.MethodModifier.Override,use:"JooseX.CPS.Continuation",methods:{prepareWrapper:function(c){var a=this.SUPER(c);var b=function(){var d=this.CONT||Joose.top.__GLOBAL_CNT__||new JooseX.CPS.Continuation();return d.TRY(a,this,arguments)};b.IS_CONTINUED=true;return b}}});Class("JooseX.CPS.MethodModifier.After",{meta:Joose.Meta.Class,isa:Joose.Managed.Property.MethodModifier,use:"JooseX.CPS.Continuation",methods:{prepareWrapper:function(f){var a=f.name;var d=f.modifier;var i=f.isOwn;var c=f.target.prototype[a];var j=f.superProto;var h=f.originalCall;var g=function(){var k=i?c.IS_CONTINUED:j[a].IS_CONTINUED;if(k){h.apply(this,arguments).NOW()}else{this.CONTINUE(h.apply(this,arguments))}};var b=function(){var k=this.CONT||Joose.top.__GLOBAL_CNT__||new JooseX.CPS.Continuation();var l=arguments;return k.TRY(g,this,arguments).THEN(function(){var m=arguments;this.CONT.TRY(d,this,l).THEN(function(){this.CONTINUE.apply(this,m)}).NOW()},this)};b.IS_CONTINUED=true;return b}}});Class("JooseX.CPS.MethodModifier.Before",{meta:Joose.Meta.Class,isa:Joose.Managed.Property.MethodModifier,use:"JooseX.CPS.Continuation",methods:{prepareWrapper:function(f){var a=f.name;var d=f.modifier;var i=f.isOwn;var c=f.target.prototype[a];var j=f.superProto;var h=f.originalCall;var g=function(){var k=i?c.IS_CONTINUED:j[a].IS_CONTINUED;if(k){h.apply(this,arguments).NOW()}else{this.CONTINUE(h.apply(this,arguments))}};var b=function(){var k=this.CONT||Joose.top.__GLOBAL_CNT__||new JooseX.CPS.Continuation();return k.TRY(function(){this.CONT.TRY(d,this,arguments).NOW()},this,arguments).THEN(g,this,arguments)};b.IS_CONTINUED=true;return b}}});Class("JooseX.CPS.MethodModifier.Put",{isa:"JooseX.CPS.MethodModifier.Override",methods:{prepareWrapper:function(a){if(a.isOwn){throw"Method ["+a.name+"] is applying over something ["+a.originalCall+"] in class ["+a.target+"]"}return this.SUPER(a)}}});Class("JooseX.CPS.Builder",{meta:Joose.Meta.Class,use:["JooseX.CPS.MethodModifier.Put","JooseX.CPS.MethodModifier.After","JooseX.CPS.MethodModifier.Before","JooseX.CPS.MethodModifier.Override"],isa:Joose.Managed.Builder,methods:{methods:function(c,b){var a=c.stem.properties.methods;Joose.O.eachOwn(b,function(f,d){a.addProperty(d,{meta:JooseX.CPS.MethodModifier.Put,init:f})})},after:function(b,a){Joose.O.each(a,function(d,c){b.addMethodModifier(c,d,JooseX.CPS.MethodModifier.After)},this)},before:function(b,a){Joose.O.each(a,function(d,c){b.addMethodModifier(c,d,JooseX.CPS.MethodModifier.Before)},this)},override:function(b,a){Joose.O.each(a,function(d,c){b.addMethodModifier(c,d,JooseX.CPS.MethodModifier.Override)},this)},have:function(){throw"'have' builder is not supported in the 'continued' section"},havenot:function(){throw"'havenot' builder is not supported in the 'continued' section"},around:function(){throw"'around' builder is not supported in the 'continued' section"},augment:function(){throw"'augment' builder is not supported in the 'continued' section"},does:function(){throw"'does' builder is not supported in the 'continued' section"},doesnot:function(){throw"'doesnot' builder is not supported in the 'continued' section"}}});Role("JooseX.CPS.ControlFlow",{use:["JooseX.CPS.Continuation"],has:{CONT:null,RESULT:null,RESULTS:null},methods:{TRY:function(c,b,a){return this.CONT.TRY(c,b||this,a)},AND:function(c,b,a){return this.CONT.AND(c,b||this,a)},THEN:function(c,b,a){return this.CONT.THEN(c,b||this,a)},NEXT:function(c,b,a){return this.CONT.NEXT(c,b||this,a)},NOW:function(){var a=this.CONT;return a.NOW.apply(a,arguments)},CONTINUE:function(){var a=this.CONT;a.CONTINUE.apply(a,arguments)},RETURN:function(){var a=this.CONT;a.RETURN.apply(a,arguments)},THROW:function(){var a=this.CONT;a.THROW.apply(a,arguments)},getCONTINUE:function(){return this.CONT.getCONTINUE()},getRETURN:function(){return this.CONT.getRETURN()},getTHROW:function(){return this.CONT.getTHROW()}}});Role("JooseX.CPS",{use:["JooseX.CPS.Builder","JooseX.CPS.ControlFlow"],has:{continuedBuilder:null},after:{processStem:function(){this.continuedBuilder=new JooseX.CPS.Builder({targetMeta:this});this.addRole(JooseX.CPS.ControlFlow)}},builder:{methods:{continued:function(b,a){b.continuedBuilder._extend(a)}}}});
112 lib/Task/Joose/NodeJS.mmd
@@ -0,0 +1,112 @@
+Name
+====
+
+
+Task.Joose.NodeJS - Joose, packaged with NodeJS flavour
+
+
+SYNOPSIS
+========
+
+ require('Task/Joose/NodeJS')
+
+
+ Role('Winged', {
+ has : {
+ leftWing : { is : 'rw' },
+ rightWing : { is : 'rw' }
+ },
+
+ methods : {
+
+ flight : function () {
+ this.leftWing.flutter()
+ this.rightWing.flutter()
+ },
+
+ land : function () {
+ this.leftWing.hold()
+ this.rightWing.hold()
+ }
+ }
+ })
+
+
+
+ Class('Bird', {
+ isa : Animal,
+
+ does : Winged
+ })
+
+
+ Class('Gryphon', {
+ isa : Lion,
+
+ does : Winged
+ })
+
+
+
+DESCRIPTION
+===========
+
+`Task.Joose.NodeJS` is a package, containing Joose along with several essential extensions:
+
+>* Joose 3.008 (XXX release)
+>* JooseX.Attribute 0.02 (XXX release)
+>* JooseX.Namespace.Depended 0.02|3 (XXX release)
+>* JooseX.CPS 0.02 (XXX release)
+
+
+EXAMPLES
+========
+
+
+GETTING HELP
+============
+
+This extension is supported via github issues tracker: <http://github.com/SamuraiJack/Task-Joose-NodeJS/issues>
+
+For general Joose questions you can also visit #joose on irc.freenode.org or the forum at: <http://joose.it/forum>
+
+
+
+SEE ALSO
+========
+
+Web page of this module: <http://github.com/SamuraiJack/Task-Joose-NodeJS/>
+
+General documentation for Joose: <http://openjsan.org/go/?l=Joose>
+
+
+BUGS
+====
+
+All complex software has bugs lurking in it, and this module is no exception.
+
+Please report any bugs through the web interface at <http://github.com/SamuraiJack/Task-Joose-NodeJS/issues>
+
+
+
+AUTHORS
+=======
+
+Nickolay Platonov <nplatonov@cpan.org>
+
+
+
+COPYRIGHT AND LICENSE
+=====================
+
+Copyright (c) 2009, Nickolay Platonov
+
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+
+* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+* Neither the name of Nickolay Platonov nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
61 script/create.pl
@@ -0,0 +1,61 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+use FindBin;
+use lib "$FindBin::Bin/lib";
+
+use Path::Class;
+
+
+#======================================================================================================================================================================================
+# detecting JSAN root
+
+use Module::Build::JSAN::Installable;
+
+
+my $jsan_root = dir(Module::Build::JSAN::Installable::get_jsan_libroot(), 'lib');
+
+
+#======================================================================================================================================================================================
+# setting up the package content
+
+my @package = (
+ 'Task.Joose.Core',
+ 'Task.JooseX.Attribute.Bootstrap',
+ 'Task.JooseX.Namespace.Depended.NodeJS',
+ 'Task.JooseX.CPS.All'
+);
+
+
+#======================================================================================================================================================================================
+# concatenating
+
+
+my $content = '';
+
+foreach my $module (@package) {
+
+ my @dirs = split /\./, $module;
+ $dirs[ -1 ] .= '.js';
+
+ $content .= ";\n;" . $jsan_root->file(@dirs)->slurp();
+}
+
+
+
+#======================================================================================================================================================================================
+# writing the results
+
+my $package_file = file("$FindBin::Bin/../lib/Task/Joose/NodeJS.js");
+
+
+my $fh = $package_file->openw;
+
+print $fh $content;
+
+$fh->close;
+
+
+print `java -jar bin/yuicompressor-2.4.2.jar -o lib/Task/Joose/NodeJS.js lib/Task/Joose/NodeJS.js`;
16 t/010_sanity.t.js
@@ -0,0 +1,16 @@
+StartTest(function(t) {
+
+ t.plan(1)
+
+ var async0 = t.beginAsync()
+
+ use('Task.Joose.NodeJS', function () {
+
+ //======================================================================================================================================================================================================================================================
+ t.diag('Sanity')
+
+ t.ok(Task.Joose.NodeJS, "Task.Joose.NodeJS is here")
+
+ t.endAsync(async0)
+ })
+})
57 t/index.html
@@ -0,0 +1,57 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html>
+ <head>
+ <script type="text/javascript" src="/jsan/Task/Joose/Stable.js"></script>
+
+ <link rel="stylesheet" type="text/css" href="/jsan/Task/ExtJS/resources/css/ext-all.css">
+
+ <!-- Ext bridge -->
+
+ <script type="text/javascript" src="/jsan/Task/ExtJS/Adapter/Ext.js"></script>
+
+ <script type="text/javascript" src="/jsan/JooseX/Meta/Lazy.js"></script>
+ <script type="text/javascript" src="/jsan/JooseX/Bridge/Ext.js"></script>
+ <script type="text/javascript" src="/jsan/JooseX/Bridge/Ext/LazyConvertor.js"></script>
+
+ <script type="text/javascript" src="/jsan/Task/ExtJS/All.js"></script>
+
+ <!-- eof Ext bridge -->
+
+
+ <script type="text/javascript" src="/jsan/ExtX/Reference/Slot.js"></script>
+
+ <link rel="stylesheet" type="text/css" href="/jsan/Test/Run/static/css/all.css">
+ <script type="text/javascript" src="/jsan/Task/Test/Run/ExtJS.js"></script>
+ </head>
+
+
+ <body>
+ <script type="text/javascript">
+ var INC = []
+ Joose.A.each([ '../lib', '/jsan' ], function (path) {
+ INC.push(Test.Run.Harness.Browser.Multi.my.resolveUrl(path, true))
+ })
+
+
+ Test.Run.Harness.Browser.Multi.my.configure({
+ title : 'Task.Joose.NodeJS Test Suite',
+
+ passThroughEx : true,
+
+ preload : [
+ '/jsan/Task/Joose/Core.js',
+ "/jsan/JooseX/SimpleRequest.js",
+ '/jsan/Task/JooseX/Namespace/Depended/Web.js',
+ {
+ text : "JooseX.Namespace.Depended.Manager.my.INC = " + Ext.encode(INC)
+ }
+ ]
+ })
+
+
+ Test.Run.Harness.Browser.Multi.my.start(
+ '010_sanity.t.js'
+ )
+ </script>
+ </body>
+</html>
Please sign in to comment.
Something went wrong with that request. Please try again.