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

Refactoring let (e.g. reduce scope) #3294

Merged
merged 14 commits into from
Nov 5, 2018
Merged

Conversation

segayuu
Copy link
Contributor

@segayuu segayuu commented Oct 18, 2018

  • Add test cases for the changes.
  • Passed the CI test.

@segayuu segayuu requested a review from a team October 18, 2018 03:07
@coveralls
Copy link

coveralls commented Oct 18, 2018

Coverage Status

Coverage increased (+0.006%) to 97.228% when pulling a258716 on segayuu:refactoring-let into 3fbbe5d on hexojs:master.

@segayuu
Copy link
Contributor Author

segayuu commented Oct 24, 2018

The cause of failure only with currentVersion (11.0.0) is unknown.

@tomap
Copy link
Contributor

tomap commented Oct 24, 2018

Also confused

@tomap
Copy link
Contributor

tomap commented Oct 24, 2018

Quick way to fix/debug, split in two your changes, which seem pretty isolated, and make two PRs, and repeat with whichever fails...

@tomap
Copy link
Contributor

tomap commented Oct 24, 2018

Oups, sorry, I just spotted that it has nothing to do with your changes. Maybe a minor update on one of our dependency triggered that...

@segayuu
Copy link
Contributor Author

segayuu commented Oct 25, 2018

As a result of examination, it turned out that it was caused by the difference of nodejs version.
The initial value of the depth option of util.inspect() has changed since node v11.
node v11: 20 node v10: 2
Here is the test line where the error appears.
Given the default value change, it is clear that the test on this line will fail on v11.

In #3305 I am fixing the code that causes the error.


args.unshift(data);

for (let i = 0, len = filters.length; i < len; i++) {
result = filters[i].apply(ctx, args);
const result = filters[i].apply(ctx, args);
Copy link
Member

Choose a reason for hiding this comment

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

I'm not understanding why we need to change this? Due to performance?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If that comment is about this line, the purpose is to reduce the scope of result.

@NoahDragon
Copy link
Member

Is this still WIP? I saw the travis passed in the last commit, but it is failed now.

@segayuu
Copy link
Contributor Author

segayuu commented Nov 5, 2018

An error occurred because the conflict resolution failed. It is resolved now.

Copy link
Member

@NoahDragon NoahDragon left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks for making the code cleaner and easier to read.

@segayuu segayuu merged commit 087b3fa into hexojs:master Nov 5, 2018
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.

4 participants