Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clone fails on objects with null prototypes #139

jquense opened this Issue Apr 9, 2015 · 0 comments


None yet
3 participants
Copy link

jquense commented Apr 9, 2015

Hi! I often do Object.create(null) for poor man's hashs, since it creates an object without the builtin methods like hasOwnProperty. Currently the clone() method will ignore these objects and set them to the new object, so both end up sharing a reference

var a = { obj: Object.create(null) }

var b = hoek.clone(a)

assert(b.obj !== a.obj) // fails

The issue seems to be this line

@nlf nlf added the bug label Apr 9, 2015

@nlf nlf closed this in 1d86062 May 22, 2015

@hueniverse hueniverse removed the help wanted label May 22, 2015

@hueniverse hueniverse added this to the 2.14.0 milestone May 22, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.