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
Merged

Fix #1092 #1140

merged 4 commits into from May 5, 2016

Conversation

andsnpl
Copy link
Contributor

@andsnpl andsnpl 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
Copy link
Collaborator

megawac commented May 4, 2016

Looks good, /cc @aearly

@megawac
Copy link
Collaborator

megawac 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?

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

import arrayEach from 'lodash/_arrayEach';
import forOwn from 'lodash/forOwn';
import indexOf from 'lodash/_baseIndexOf';
import indexOf from 'lodash/indexOf';
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you change this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Collaborator

aearly 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.

@andsnpl
Copy link
Contributor Author

andsnpl 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
@megawac
Copy link
Collaborator

megawac commented May 5, 2016

Good stuff! thanks

@andsnpl andsnpl deleted the fix-#1092 branch May 12, 2016 02:47
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.

None yet

3 participants