Skip to content
Closed
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions test/addons/callback-scope/test-resolve-async.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ const assert = require('assert');
const { testResolveAsync } = require(`./build/${common.buildType}/binding`);

let called = false;
testResolveAsync().then(common.mustCall(() => {
called = true;
}));
testResolveAsync().then(() => (called = true));
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Any reason for the parentheses here instead of the seemingly-more-idiomatic curly braces?


setTimeout(common.mustCall(() => { assert(called); }),
common.platformTimeout(20));
setTimeout(() => assert(called), common.platformTimeout(50));
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

My usual comment: I'd prefer the assert(called) be wrapped in curly braces to make it clear that there is no intention of returning a value here. I suspect I'm on the losing end of this particular unimportant style debate. :-P

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I don't have a strong preference so I've gone ahead and changed it.