Comparing version 0.12.0 to 0.12.2
{ | ||
"name": "clank", | ||
"version": "0.12.0", | ||
"version": "0.12.2", | ||
"description": "lightweight inhertiance and compositional object model. mostly just helpers", | ||
@@ -37,4 +37,4 @@ "main": "index.js", | ||
"lodash": "~2.4.1", | ||
"cobble": "~0.16.1" | ||
"cobble": "~0.16.3" | ||
} | ||
} |
@@ -10,3 +10,3 @@ Clank | ||
works fine in IE8 but does expect certain es5 functions, include es5 shim and sham in an IE8 and everything will work fine, with a single caveat, object constructors are assigned a non-enumerable property `__META__`, which in IE8 _is_ enumerable, so keep that in mind. | ||
works fine in IE8 but does expect certain es5 functions, include es5 shim and sham in IE8 and everything will work fine, with a single caveat: object constructors are assigned a non-enumerable property `__META__`, which in IE8 _is_ enumerable, so keep that in mind. | ||
@@ -62,3 +62,3 @@ ## API | ||
`.reopen` is like extend but `.extend` of creating a new Class it alters the current class prototype. Changes made to the prototype will cascade throguh the object heirarchy. `.reopen` has the same signature as `.extend`. | ||
`.reopen` is like `.extend` but instead of creating a new Class it alters the current class prototype. Changes made to the prototype will cascade throguh the object heirarchy. `.reopen` has the same signature as `.extend`. | ||
@@ -139,2 +139,2 @@ var Person = Clank.Object.extend({ species: 'homo sapien'}) | ||
In a few cases where you need to dynamically reference the super class, super han be accessed by `this._super([method]) => returns the method` inside a class method, however, there are a bunch of pitfalls and caveats related to its use, which is why it is __underscored__. Consult the super tests for insight into the limitations of this method. | ||
In a few cases where you need to dynamically reference the super class, super han be accessed by `this._super([method]) => returns the method` inside a class method, however, there are a bunch of pitfalls and caveats related to its use, which is why it is __underscored__. Consult the super tests for insight into the limitations of this method. |
@@ -40,2 +40,15 @@ var chai = require('chai') | ||
it( 'should be able to provide a constructor', function(){ | ||
var spy | ||
, Person = Clank.Object.extend({ greeting: 'guten tag' }) | ||
, Man = Person.extend({ | ||
constructor: spy = sinon.spy(function(){ | ||
Person.call(this) | ||
}) | ||
}); | ||
var me = Man.create() | ||
spy.should.have.been.calledOnce | ||
}) | ||
it( 'should compose init props', function(){ | ||
@@ -42,0 +55,0 @@ var Person = Clank.Object.extend({ greeting: function(){ return 'guten morgen' } }) |
25572
11
429
138
Updatedcobble@~0.16.3