Skip to content

Instantly share code, notes, and snippets.

View canonic-epicure's full-sized avatar
💭
Well-typed API for the world

Nickolay Platonov canonic-epicure

💭
Well-typed API for the world
View GitHub Profile
Ext.ns('Test.Run.Harness.Browser.UI')
Test.Run.Harness.Browser.UI.Viewport = Ext.extend(Ext.Viewport, {
title : null,
harness : null,
initComponent : function () {
Class('Test.Run.Harness.Browser.UI.Viewport', {
xtype : 'my-viewport',
isa : Ext.Viewport,
have : {
title : null,
harness : null
Class('Symbie.Application', {
isa : Ext.util.Observable,
meta : JooseX.Bridge.Ext,
trait : 'JooseX.CPS',
does : [ 'Symbie.ID' ],
Class('Name', {
//usual methods
does : {},
has : {}
methods : {},
//class methods/attributes
my : {
does : {},
Class('Some.Class', {
customBuilder : { <-- info
something here
}
})
Role('JooseX.Class.Triggered', {
stem : {
have : {
attributesMC : Class({
isa : Joose.Managed.StemElement.Attributes,
propertyMetaClass : Class({
isa : Joose.Managed.Attribute,
does : JooseX.Attribute.Trigger
})
var x = {}
typeof x == 'Object' //true
x === Object //false
Module('Some.Module', {
VERSION : 0.01,
use : {
'Some.Another.Module' : 0.01,
'Yet.Another.Module' : 0.03
},
EXPORT : [ 'func1', 'func2' ],
var a = function (Joose, glob) {
eval("console.log(Joose)")
eval("console.log(glob())")
}
a('KindaJoose', function () { return 'exported glob' })
console.log(window.glob, window.Joose)
// ================================================
// Using CommonJS modules in Joose - basic
Module('Graphic.Circle', function (module) {
// this == Graphic.Circle
// module == Graphic.Circle
var puts = require('sys').puts