This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require.paths.unshift('/home/nickolay/Playground/nodejs'); | |
require('Task/Joose/NodeJS'); | |
var sys = require('sys'); | |
Joose.Module('SuperStuff', { | |
require : [ 'faye'], | |
use : [ 'Task/JooseX/Class/SimpleConstructor/Core', 'Task/JooseX/Role/Parameterized/Core', 'JooseX/Class/Singleton' ], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Class('Some.Another.Module', { | |
use : ['Some.Joose.Module'] | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Script = process.binding('evals').Script | |
var sys = require('sys') | |
var puts = sys.puts | |
var runner = function (code) { return eval(code) } | |
var sandbox = {} | |
sandbox.me = sandbox |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Role('Some.Trait', { | |
builder : { | |
methods : { | |
newBuilder : function (meta, info) { | |
meta.addProperty(...) | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// sudden fail: | |
var a = instance.method() | |
(function() { | |
})() | |
eq |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Role('JooseX.Attribute.Delegated', { | |
have : { | |
handles : null | |
}, | |
override : { | |
getAccessorsFor : function (targetClass) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Class("My.Class", { | |
use: ["Some.Module"], // trigger async loading | |
body : function (m) { | |
// m == this == My.Class here | |
// class will be ready here | |
}}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require('Task/Joose/NodeJS') | |
var puts = require('sys').puts | |
Class('Some.Class', { | |
has : { | |
attrib : { | |
is : 'rw', | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require('Task/Joose/NodeJS') | |
var puts = require('sys').puts | |
Class('Some.Class', { | |
has : { | |
attrib : { | |
is : 'rw', | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Class('Custom.Property', { | |
isa : Joose.Managed.Property, | |
does : Some.Role | |
// wrong, as Custom.Property will have the same meta-class as Joose.Managed.Property | |
// which is on 1st level and don't know what Role is | |
}) | |
Class('Custom.Property', { |