Comparing version 0.2.0 to 0.2.1
{ | ||
"name": "minimal-js", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"homepage": "https://github.com/cztomsik/minimal-js", | ||
@@ -5,0 +5,0 @@ "authors": [ |
@@ -37,4 +37,4 @@ 'use strict'; | ||
var res = extend(this, data, {constructor: Clz}); | ||
return (res.init && res.init.apply(res, arguments)) || res; | ||
return (proto.init && proto.init.apply(res, arguments)) || res; | ||
} | ||
} |
{ | ||
"name": "minimal-js", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"description": "minimal js extensions", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -68,3 +68,3 @@ # minimal-js | ||
it is possible to define static methods with extend, . | ||
it is possible to define static methods with extend. | ||
@@ -98,2 +98,3 @@ ```js | ||
; | ||
assert(heroes[0].name === 'Batman'); | ||
@@ -109,2 +110,15 @@ assert(heroes[0].hello() === 'Hello, Batman'); | ||
data.init wont be called (inheritance). | ||
```js | ||
var | ||
BaseModel = defClass('BaseModel', {}), | ||
User = defClass('User', new BaseModel({ | ||
init: function(){ | ||
assert.fail(); | ||
} | ||
})) | ||
; | ||
``` | ||
<a name="dotprop-args"></a> | ||
@@ -152,3 +166,3 @@ # dot(prop, args...) | ||
; | ||
assert.deepEqual(initials, ['B', 'J']); | ||
@@ -169,3 +183,3 @@ ``` | ||
var dest = {prop: 'test'}; | ||
extend(dest, {newProp: 'test'}); | ||
@@ -179,3 +193,3 @@ assert(dest.newProp === 'test'); | ||
var dest = {prop: 'test'}; | ||
extend(dest, {prop: 'new'}); | ||
@@ -189,3 +203,3 @@ assert(dest.prop === 'new'); | ||
var a = {}, b = {}; | ||
assert(extend(a) === a); | ||
@@ -199,3 +213,3 @@ assert(extend(a, b) === a); | ||
var src = {prop: 'test'}; | ||
assert.deepEqual(extend({}, src), src); | ||
@@ -208,3 +222,3 @@ ``` | ||
var a = {a: 1}, b = {b: 2}, c = {c: 3}; | ||
assert.deepEqual(extend(a, b, c), extend(extend(a, b), c)); | ||
@@ -228,1 +242,2 @@ ``` | ||
``` | ||
@@ -64,3 +64,3 @@ 'use strict'; | ||
it('it is possible to define static methods with extend, ', function(){ | ||
it('it is possible to define static methods with extend', function(){ | ||
var | ||
@@ -98,2 +98,13 @@ ActiveRecord = extend(defClass('ActiveRecord', {}), { | ||
}); | ||
it('data.init wont be called (inheritance)', function(){ | ||
var | ||
BaseModel = defClass('BaseModel', {}), | ||
User = defClass('User', new BaseModel({ | ||
init: function(){ | ||
assert.fail(); | ||
} | ||
})) | ||
; | ||
}); | ||
}); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
12567
228
234