mirror of
https://github.com/flynx/object.js.git
synced 2025-10-29 02:20:08 +00:00
searching for an obscure but... (not done yet)
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
664cd96908
commit
30a7c99dcc
36
test.js
36
test.js
@ -774,6 +774,42 @@ var cases = test.Cases({
|
||||
assert('c' in z == false, 'post-mixout (partial) content gone')
|
||||
//*/
|
||||
},
|
||||
|
||||
'extending-call': function(assert){
|
||||
var A = object.C('A', {
|
||||
__call__: function(){
|
||||
return ['A'] },
|
||||
})
|
||||
|
||||
var B = object.C('B', A, {
|
||||
__call__: function(){
|
||||
return object.parentCall(B.prototype, '__call__', this).concat(['B']) },
|
||||
//return object.parentCall(B.prototype.__call__, this).concat(['B']) },
|
||||
})
|
||||
|
||||
var C = object.C('C', B, {
|
||||
__call__: function(){
|
||||
// XXX BUG: this will break..
|
||||
// the broblem is in that:
|
||||
// object.parent(C.prototype, '__call__', this)
|
||||
// object.parent(C.prototype.__call__, this)
|
||||
// ..are not the same...
|
||||
return object.parentCall(C.prototype.__call__, this).concat(['C']) },
|
||||
})
|
||||
|
||||
var a = A()
|
||||
var b = B()
|
||||
var c = C()
|
||||
|
||||
// XXX BUG....
|
||||
assert(
|
||||
object.parent(C.prototype, '__call__', c)
|
||||
=== object.parent(C.prototype.__call__, c), '...')
|
||||
|
||||
assert.array(a(), ['A'], 'call')
|
||||
assert.array(b(), ['A', 'B'], 'call')
|
||||
assert.array(c(), ['A', 'B', 'C'], 'call')
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user