mirror of
https://github.com/flynx/object.js.git
synced 2025-10-30 19:10:11 +00:00
another bugfix...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
a96a1fb803
commit
59f78fb7d4
@ -1086,7 +1086,7 @@ function Constructor(name, a, b, c){
|
|||||||
Object.assign(
|
Object.assign(
|
||||||
Object.getOwnPropertyDescriptor(Function.prototype, n),
|
Object.getOwnPropertyDescriptor(Function.prototype, n),
|
||||||
{ value: function(){
|
{ value: function(){
|
||||||
return this.__call__[n](...arguments) }, })) })
|
return this.__call__[n](this, ...arguments) }, })) })
|
||||||
|
|
||||||
return _constructor }
|
return _constructor }
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "ig-object",
|
"name": "ig-object",
|
||||||
"version": "5.2.1",
|
"version": "5.2.2",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "object.js",
|
"main": "object.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
18
test.js
18
test.js
@ -441,6 +441,14 @@ module.modifiers = {
|
|||||||
gen3: function(assert, setup){
|
gen3: function(assert, setup){
|
||||||
return this.gen2(assert, this.gen2(assert, setup), '3') },
|
return this.gen2(assert, this.gen2(assert, setup), '3') },
|
||||||
|
|
||||||
|
// create instance clones via Object.create(..)
|
||||||
|
//
|
||||||
|
clones: function(assert, setup){
|
||||||
|
return instances(setup)
|
||||||
|
.reduce(function(res, [k, o]){
|
||||||
|
res[k] = Object.create(o)
|
||||||
|
return res }, {}) },
|
||||||
|
|
||||||
// generate instances...
|
// generate instances...
|
||||||
//
|
//
|
||||||
// NOTE: these are re-used as tests too...
|
// NOTE: these are re-used as tests too...
|
||||||
@ -618,13 +626,19 @@ module.tests = {
|
|||||||
instances(setup)
|
instances(setup)
|
||||||
.filter(function([_, o]){
|
.filter(function([_, o]){
|
||||||
// NOTE: not all callables are instances of Function...
|
// NOTE: not all callables are instances of Function...
|
||||||
return typeof(o) == 'function' })
|
return typeof(o) == 'function'
|
||||||
|
|| !!o.__call__ })
|
||||||
.forEach(function([k, o]){
|
.forEach(function([k, o]){
|
||||||
o.__non_function ?
|
o.__non_function ?
|
||||||
assert(!(o instanceof Function), 'non-instanceof Function', k)
|
assert(!(o instanceof Function), 'non-instanceof Function', k)
|
||||||
: assert(o instanceof Function, 'instanceof Function', k)
|
: assert(o instanceof Function, 'instanceof Function', k)
|
||||||
|
|
||||||
assert(o(), 'call', k)
|
typeof(o) == 'function'
|
||||||
|
&& assert(o(), 'call', k)
|
||||||
|
|
||||||
|
assert(o.call(), '.call(..)', k)
|
||||||
|
assert(o.apply(), 'apply(..)', k)
|
||||||
|
assert(o.bind(null)(), '.bind(..)(..)', k)
|
||||||
|
|
||||||
test(o, k)
|
test(o, k)
|
||||||
})
|
})
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user