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 #1092 #1140

Merged
merged 4 commits into from May 5, 2016

Conversation

@b-paul
Copy link
Contributor

commented May 3, 2016

I believe this does the job requested.

The error text does not report which key(s) are involved in the cycle if one is detected. I haven't spent any thought on that, but will try to figure it out if needed.

@megawac

This comment has been minimized.

Copy link
Collaborator

commented May 4, 2016

Looks good, /cc @aearly

@megawac

This comment has been minimized.

Copy link
Collaborator

commented May 4, 2016

Also as we've started using some external dependencies in v2, do you think it makes sense to use an existing graph (with dag support) implementation in auto?

lib/auto.js Outdated
@@ -2,7 +2,7 @@

import arrayEach from 'lodash/_arrayEach';
import forOwn from 'lodash/forOwn';
import indexOf from 'lodash/_baseIndexOf';
import indexOf from 'lodash/indexOf';

This comment has been minimized.

Copy link
@aearly

aearly May 4, 2016

Collaborator

Why did you change this?

This comment has been minimized.

Copy link
@b-paul

b-paul May 4, 2016

Author Contributor

@aearly I wrote my checkForDeadlocks assuming I had the lodash/JavaScript standard semantics. Got test failures because I hadn't included start index.

Thought I was better off importing the public API method, in case someone else were to come and repeat my mistake at another time

This comment has been minimized.

Copy link
@megawac

megawac May 4, 2016

Collaborator

We weren't importing indexof to avoid including the lodash internal
toInteger implementation
On May 4, 2016 3:53 PM, "Paul Anderson" notifications@github.com wrote:

In lib/auto.js
#1140 (comment):

@@ -2,7 +2,7 @@

import arrayEach from 'lodash/_arrayEach';
import forOwn from 'lodash/forOwn';
-import indexOf from 'lodash/_baseIndexOf';
+import indexOf from 'lodash/indexOf';

@aearly https://github.com/aearly I wrote my checkForDeadlocks assuming
I had the lodash/JavaScript standard semantics. Got test failures because I
hadn't included start index.

Thought I was better off importing the public API method, in case someone
else were to come and repeat my mistake at another time


You are receiving this because you commented.
Reply to this email directly or view it on GitHub
https://github.com/caolan/async/pull/1140/files/81e888fd40e99c0de0098a7554d6cdafc540c021#r62103119

@aearly

This comment has been minimized.

Copy link
Collaborator

commented May 4, 2016

LGTM2.

If there's a tiny DAG library out there that's easy to integrate, maybe. This code has the advantage of already working with what we've defined to be a "graph", rather than having to construct a graph to verify that it's acyclic.

@b-paul

This comment has been minimized.

Copy link
Contributor Author

commented May 4, 2016

@megawac @aearly I see your concerns about indexOf. Thanks for the explanation; I should have guessed it was that way for a reason. I've pushed a commit that reverts the change and fixes the invocation to match

@megawac megawac merged commit 19585c1 into caolan:master May 5, 2016

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@megawac

This comment has been minimized.

Copy link
Collaborator

commented May 5, 2016

Good stuff! thanks

@b-paul b-paul deleted the b-paul:fix-#1092 branch May 12, 2016

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