cleanup...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2026-01-02 18:30:51 +03:00
parent cafd30bad2
commit 6fca53562b

21
test.js
View File

@ -170,7 +170,6 @@ test.Tests({
// XXX // XXX
}, },
//* XXX ERR
'partial-deep-copy': function(assert, [setup]){ 'partial-deep-copy': function(assert, [setup]){
var obj = eJSON.deserialize(setup, true) var obj = eJSON.deserialize(setup, true)
var funcs = [] var funcs = []
@ -232,20 +231,32 @@ test.Cases({
var obj = this._make_object_with_methods() var obj = this._make_object_with_methods()
var obj_copy = eJSON.deepCopy(obj, true) var obj_copy = eJSON.deepCopy(obj, true)
// sanity checks...
assert(obj.stateless() == 'stateless') assert(obj.stateless() == 'stateless')
assert(obj.stateful() == 'state_retained') assert(obj.stateful() == 'state_retained')
assert(obj_copy.stateless() == 'stateless') assert(obj_copy.stateless() == 'stateless')
assert(obj_copy.stateful() == 'state_lost') },
// context should be lost...
assert(
obj_copy.stateful() == 'state_lost',
'Function closure not lost.')
assert(obj.stateful !== obj_copy.stateful,
'Function objects retained.') },
'partial-deep-copy-function': function(assert){ 'partial-deep-copy-function': function(assert){
var obj = this._make_object_with_methods() var obj = this._make_object_with_methods()
var obj_copy = eJSON.partialDeepCopy(obj) var obj_copy = eJSON.partialDeepCopy(obj)
// sanity checks...
assert(obj.stateless() == 'stateless') assert(obj.stateless() == 'stateless')
assert(obj.stateful() == 'state_retained') assert(obj.stateful() == 'state_retained')
assert(obj_copy.stateless() == 'stateless') assert(obj_copy.stateless() == 'stateless')
assert(obj_copy.stateful() == 'state_retained') },
// context should be retained...
assert(
obj_copy.stateful() == 'state_retained',
'Function closure lost.')
assert(obj.stateful === obj_copy.stateful,
'Function objects not retained.') },
}) })