Closed paulovieira closed 8 years ago
@nlf this seems to be an issue with hoek.clone? Can you confirm?
I can work around it doing a cloneWithShallow, skipping the plugin options.
i'm not sure how to identify this as a bug in clone. is it that clone doesn't work properly on a stream? or is it that in this case cloneWithShallow is what should reasonably be used?
Hoek.clone
is working fine. I should have been more clear in the issue: sometimes the user of glue
needs access to the actual values passed in the options, not a copy. Streams are a good example.
Would it make sense to add a new clone
option for glue (besides relativeTo
, preConnections
and preRegister
)?
Ok, I'll just use cloneWithShallow to fix this then. Thanks.
This thread has been automatically locked due to inactivity. Please open a new issue for related bugs or questions following the new issue template instructions.
glue
will callHoek.clone
in theparsePlugin
method. This has the effect that some plugins stop working as expected when the values passed in the plugin options are objects or functions (in particular, streams).Below is a simple demo that exhibits the problem. It just loads the
good
plugin and passes an instance of a stream to the options (fromgood-console
). It should output some info about the server load every 1s, but an error is thrown:If we comment the
Hoek.clone
call, it works as expected.The problem will be present whenever the user needs to access the same value that is given in the plugin options (not a clone).