mirror of
https://github.com/flynx/object.js.git
synced 2025-10-29 02:20:08 +00:00
bugfix...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
00c17b3ce8
commit
a96a1fb803
@ -1083,7 +1083,10 @@ function Constructor(name, a, b, c){
|
||||
.forEach(function(n){
|
||||
proto[n]
|
||||
|| Object.defineProperty(proto, n,
|
||||
Object.getOwnPropertyDescriptor(Function.prototype, n)) })
|
||||
Object.assign(
|
||||
Object.getOwnPropertyDescriptor(Function.prototype, n),
|
||||
{ value: function(){
|
||||
return this.__call__[n](...arguments) }, })) })
|
||||
|
||||
return _constructor }
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "ig-object",
|
||||
"version": "5.2.0",
|
||||
"version": "5.2.1",
|
||||
"description": "",
|
||||
"main": "object.js",
|
||||
"scripts": {
|
||||
@ -26,7 +26,7 @@
|
||||
},
|
||||
"homepage": "https://github.com/flynx/object.js#readme",
|
||||
"devDependencies": {
|
||||
"c8": "^7.2.1",
|
||||
"c8": "^7.3.0",
|
||||
"colors": "^1.4.0",
|
||||
"ig-argv": "^2.11.2"
|
||||
}
|
||||
|
||||
18
test.js
18
test.js
@ -690,7 +690,23 @@ module.cases = {
|
||||
assert.array(object.deepKeys(c, b), ['c', 'b'], 'partial chain')
|
||||
assert.array(object.deepKeys(c, c), ['c'], 'partial chain')
|
||||
|
||||
}
|
||||
},
|
||||
funcMethods: function(assert){
|
||||
var X = object.C('X', {
|
||||
__call__: function(){
|
||||
return true },
|
||||
})
|
||||
|
||||
var x = new X()
|
||||
|
||||
assert(x(), 'x()')
|
||||
assert(x.call(null), 'x.call(null)')
|
||||
|
||||
var xx = Object.create(x)
|
||||
|
||||
assert(typeof(xx.call) == 'function', 'xx.call is a function')
|
||||
assert(xx.call(null), 'xx.call(null)')
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user