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

benchmark: add default value for settings param #45594

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

xtx1130
Copy link
Contributor

@xtx1130 xtx1130 commented Nov 23, 2022

It will cause an error when I try to import _cli.js:

const CLI = require('./benchmark/_cli.js');
const cli = new CLI('');

TypeError: Cannot read properties of undefined (reading 'arrayArgs')
    at new CLI (/Users/didi/Desktop/node/benchmark/_cli.js:28:34)
    at Object.<anonymous> (/Users/didi/Desktop/node/benchmark/test-cli.js:2:13)
    at Module._compile (node:internal/modules/cjs/loader:1120:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1174:10)
    at Module.load (node:internal/modules/cjs/loader:998:32)
    at Module._load (node:internal/modules/cjs/loader:839:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
    at node:internal/main/run_main_module:17:47

So I try to use kEmptyObject as default settings value for benchmark CLI.

@nodejs-github-bot nodejs-github-bot added benchmark Issues and PRs related to the benchmark subsystem. needs-ci PRs that need a full CI run. test Issues and PRs related to the tests. labels Nov 23, 2022
@xtx1130
Copy link
Contributor Author

xtx1130 commented Dec 8, 2022

PTAL

benchmark/_cli.js Outdated Show resolved Hide resolved
Comment on lines 109 to 110
const filters = this.optional.filter ? [...this.optional.filter] : [];
const excludes = this.optional.exclude ? [...this.optional.exclude] : [];
Copy link
Contributor

Choose a reason for hiding this comment

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

This looks unrelated

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Emmm... I have forgot why a add spread syntax in there. This PR has been a long time coming, I have made a code review, and I think it is unnecessary too.I will restore it

@aduh95 aduh95 added the stalled Issues and PRs that are stalled. label May 11, 2024
Copy link
Contributor

This issue/PR was marked as stalled, it will be automatically closed in 30 days. If it should remain open, please leave a comment explaining why it should remain open.

Copy link
Contributor Author

@xtx1130 xtx1130 left a comment

Choose a reason for hiding this comment

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

I will update my commit ASAP

Comment on lines 109 to 110
const filters = this.optional.filter ? [...this.optional.filter] : [];
const excludes = this.optional.exclude ? [...this.optional.exclude] : [];
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Emmm... I have forgot why a add spread syntax in there. This PR has been a long time coming, I have made a code review, and I think it is unnecessary too.I will restore it

@xtx1130
Copy link
Contributor Author

xtx1130 commented Jun 19, 2024

PTAL.

  • CR fixed
  • add optional test case for benchmark cli

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
benchmark Issues and PRs related to the benchmark subsystem. needs-ci PRs that need a full CI run. stalled Issues and PRs that are stalled. test Issues and PRs related to the tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants