From 6fca53562b2e6127aad9180ce674bcdbde0fcf0e Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Fri, 2 Jan 2026 18:30:51 +0300 Subject: [PATCH] cleanup... Signed-off-by: Alex A. Naanou --- test.js | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/test.js b/test.js index d99afd5..25ee4fc 100755 --- a/test.js +++ b/test.js @@ -170,7 +170,6 @@ test.Tests({ // XXX }, - //* XXX ERR 'partial-deep-copy': function(assert, [setup]){ var obj = eJSON.deserialize(setup, true) var funcs = [] @@ -232,20 +231,32 @@ test.Cases({ var obj = this._make_object_with_methods() var obj_copy = eJSON.deepCopy(obj, true) + // sanity checks... assert(obj.stateless() == 'stateless') assert(obj.stateful() == 'state_retained') - 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){ var obj = this._make_object_with_methods() var obj_copy = eJSON.partialDeepCopy(obj) + // sanity checks... assert(obj.stateless() == 'stateless') assert(obj.stateful() == 'state_retained') - 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.') }, })