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

Fix clone of subclassed Set and Map #302

Merged
merged 1 commit into from May 26, 2019

Conversation

@kanongil
Copy link
Member

kanongil commented May 23, 2019

I just wanted to fix the harmless double seen.set() for Set and Map clones introduced in #301, but found a new bug: Hoek.clone() does not transfer the prototype of a subclassed Set or Map.

I did a fix for this, but found that objects created using Object.create(proto) are broken. Instead I ended up at this, where I create a base object, and change its prototype (if required).

There is a lot of changes here, but most is refactoring to make a somewhat clean and performant implementation.

@kanongil kanongil added the bug label May 23, 2019
@hueniverse hueniverse added this to the 6.2.4 milestone May 26, 2019
@hueniverse hueniverse merged commit 98514c5 into hapijs:master May 26, 2019
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
hueniverse added a commit that referenced this pull request May 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.