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

Unreachable code in circular reference check? #13

Merged
merged 1 commit into from
Feb 22, 2016

Conversation

jmm
Copy link
Contributor

@jmm jmm commented Feb 21, 2016

When I was doing #12 I started looking at deduplicating the circular reference checks but got bogged down with code style issues. Then I wondered if all of that code is actually reachable. I tried to run the coverage report but it errored out for me. But as demonstrated by this PR, the chunk I'm referring to is not covered; with this change existing tests (and those I add in #12) pass. Is there a situation I haven't thought of where this would be reachable?

@ljharb
Copy link
Member

ljharb commented Feb 21, 2016

ok, so - I added it initially because I was being careful that both iteration of "value" and "other" had the same checks.

However, I think I see why this change works - because the only reason to have the second iteration in the first place is to ensure that there are no keys in "other" that are missing from "value".

Since all the tests pass, I think this is OK - can you rebase this on the latest master, and I'll bring it in? (bonus points if you can prefix the commit message with "[Refactor]")

@jmm jmm force-pushed the circ-ref-unreachable branch from f6318ce to 8af4f70 Compare February 22, 2016 13:56
@jmm
Copy link
Contributor Author

jmm commented Feb 22, 2016

However, I think I see why this change works - because the only reason to have the second iteration in the first place is to ensure that there are no keys in "other" that are missing from "value".

Yeah, I can't see a way for the iteration of other to get past that check.

Since all the tests pass, I think this is OK - can you rebase this on the latest master, and I'll bring it in?

Sure, done ✨

@ljharb ljharb merged commit 8af4f70 into inspect-js:master Feb 22, 2016
@ljharb
Copy link
Member

ljharb commented Feb 22, 2016

Thanks!

1 similar comment
@jmm
Copy link
Contributor Author

jmm commented Feb 23, 2016

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants