TOC
main
CoreObject
the constructor
creates an instance of CoreObject.
obj = ;tobe;
can accept a map of initial key/values that get set on the instance.
var technology = 'JavaScript';var domain = 'Everywhere';obj = technology: technology domain: domain; expected = technology domain;actual = objtechnology objdomain; todeep;
target/action (safe method invocation)
try
fails silently if the the target does not exist.
var target = undefined;var actual = 'something';actual = rel;tobeundefined;
invokes an action if an only if a method by that name exists on the target.
expected = 'didDoSomething';actual = ; rel; todeep;
tryOnce
fails silently if the target does not exist.
var target = undefined;var action = 'something';action = rel;tobeundefined;
only invokes action on a target if it has not been done before by tryOnce.
expected = 'didDoSomething';actual = ; rel;rel; todeep;
will invoke the same action on different targets.
expected = 'didDoSomething' 'didDoSomethingOnObj2';actual = ; rel;rel; todeep;
forgetTryHistory
fails silently if the target does not exist.
var target = undefined;var actual = 'something';actual = rel;tobeundefined;
fails silently if there is no "try history".
var target = {};var actual = 'something';actual = rel;tobeundefined;
clears the invoke history on a target so that tryOnce can fire a previously fired action again.
var target = { arr; }; expected = 'didDoSomething' 0 'didDoSomething' 2;actual = ; rel;rel;rel;rel; todeep;
derive
sets up a prototypal chain between parent and child.
rel;tobean;to;
enables invocation of the constructor of parent.
var expected = didInvokeParentConstructor: true didInvokeChildConstructor: true cRef: 'C' c2Ref: 'C2' pRef: 'P' p2Ref: 'P2';var actual;var c c2;var p p2; var { thisref = ref; thisdidInvokeParentConstructor = true;}; var { C_superconstructor; thisdidInvokeChildConstructor = true;}; rel; p = 'P';c = 'C';p2 = 'P2';c2 = 'C2'; actual = didInvokeParentConstructor: cdidInvokeParentConstructor didInvokeChildConstructor: cdidInvokeChildConstructor cRef: cref c2Ref: c2ref pRef: pref p2Ref: p2ref ; todeep;
adds methods to the child that can invoke methods on the parent (i.e. super functionality).
var c p g c2; var actual;var expected = child: 'Child' child2: 'Child2' parent: 'Parent' grandParent: 'GrandParent' ; GrandParentprototype { thisref = ref;}; rel; rel; c = ;c; p = ;p; c2 = ;c2; g = ;g; actual = child: cref child2: c2ref parent: pref grandParent: gref ; todeep;
adds properties to the child.
var child;rel; child = ;to;