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

[New] include filename in error message #161

Closed
wants to merge 9 commits into from

Conversation

tcchau
Copy link
Contributor

@tcchau tcchau commented May 23, 2018

Incorporates changes submitted by @jmm to fix Issue #60, resolves test errors and merges upstream changes. Was originally PR #64.

Fixes #60. Closes #64.

jmm and others added 9 commits January 21, 2015 11:05
…into jmm-identify-parent

Fix some styling/eslint errors; update planned test cases for tests to
pass
Fix conflicts and ensure tests pass
Resolve conflicts resulting from upstream code that
does not consider the parent file which may have
triggered an error report.
since the error could be specific to a file
now.
@ljharb ljharb changed the title Fix Issue #60 [New] include filename in error message May 23, 2018
Copy link
Member

@ljharb ljharb left a comment

Choose a reason for hiding this comment

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

Would you mind rebasing this so there's no merge commits? If you use git rebase --committer-date-is-author-date it will preserve the original commit dates :-)

@@ -32,22 +32,23 @@ module.exports = function resolve(x, options, callback) {
var readFile = opts.readFile || fs.readFile;

var extensions = opts.extensions || ['.js'];
var basedir = opts.basedir || path.dirname(caller());
var y = opts.basedir || path.dirname(caller());
Copy link
Member

Choose a reason for hiding this comment

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

Can this use a better name than "y"? I'd previously renamed this to "basedir" for clarity.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi @ljharb I just basically left @jmm's code intact, but I can certainly change y to basedir instead.

However, note that y is really just a temporary variable and not intended to have any significant meaning, I'm guessing from @jmm's code, because at the end of the day, what you want is, parent and y just splits up the derivation of parent into two parts for clarity.

Anyway, let me know whether you still want y to be basedir and I will make the change.

Copy link
Member

Choose a reason for hiding this comment

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

At the time they made their PR, the variable was called "y" :-) please do change it.

@@ -23,25 +23,26 @@ module.exports = function (x, options) {
var readFileSync = opts.readFileSync || fs.readFileSync;

var extensions = opts.extensions || ['.js'];
var basedir = opts.basedir || path.dirname(caller());
var y = opts.basedir || path.dirname(caller());
Copy link
Member

Choose a reason for hiding this comment

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

same here

@tcchau
Copy link
Contributor Author

tcchau commented May 23, 2018

Closing this PR because we want to have a clean history.

@tcchau tcchau closed this May 23, 2018
@ljharb
Copy link
Member

ljharb commented May 23, 2018

@tcchau i'd have vastly preferred that you rebase instead of deleting the branch and closing the PR; is there any way to reopen this?

I'm happy to do the rebase for you if needed.

@tcchau
Copy link
Contributor Author

tcchau commented May 24, 2018

@ljharb Sorry, I couldn't see how to rebase without force pushing a new master, which prevents re-opening this PR.

@ljharb
Copy link
Member

ljharb commented May 24, 2018

@tcchau yes, force pushing a new master would have done it (since the PR came from your master branch).

@tcchau
Copy link
Contributor Author

tcchau commented May 24, 2018

@ljharb I haven't collaborated on Github in a long time, and forgot that best practice is to code your patch in a branch. I also honestly didn't expect to have to publish what I did since we were waiting for jmm to finish the PR.

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

Successfully merging this pull request may close these issues.

"Error: Cannot find module" output should include filename
3 participants