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

- coverage - Fix coverage-function v8CoverageReportCreate() throwing error EINVAL in latest nodejs-security-patch, when running win32-coverage with npm.cmd. #465

Merged
merged 3 commits into from
Jun 25, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion .ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ import moduleFs from "fs";
"type": "git",
"url": "https://github.com/jslint-org/jslint.git"
},
"version": "2024.3.26"
"version": "2024.6.1"
}, undefined, 4)
}
].map(async function ({
Expand Down
10 changes: 4 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,14 @@ jobs:
- x64
# - x86
node_version:
- 18
- 20
# - 22
python_version:
- "3.10"
- 22
os:
- macos-latest
- ubuntu-latest
- windows-latest
python_version:
- "3.10"
# base - .github/workflows/ci.yml - beg
env:
CI_MATRIX_NAME: >
Expand All @@ -55,7 +54,7 @@ jobs:
steps:
# disable autocrlf in windows
- run: |
sh -c uname
sh -c "uname -a"
echo "$(date -u +"%Y-%m-%d %TZ") - ${{ env.CI_WORKFLOW_NAME }}" # "
git config --global core.autocrlf false
# https://github.com/actions/checkout
Expand All @@ -70,7 +69,6 @@ jobs:
# https://github.com/actions/setup-node
- uses: actions/setup-node@v4
with:
architecture: ${{ matrix.architecture }}
node-version: ${{ matrix.node_version }}
# https://github.com/actions/setup-python
- uses: actions/setup-python@v5
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/on_pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@ jobs:
- x64
# - x86
node_version:
- 18
- 20
# - 22
- 22
os:
- macos-latest
- ubuntu-latest
Expand All @@ -43,20 +42,21 @@ jobs:
${{ matrix.os }}
runs-on: ${{ matrix.os }}
steps:
- run: echo "$(date -u +"%Y-%m-%d %TZ") - ${{ env.CI_WORKFLOW_NAME }}" # "
# disable autocrlf in windows
- run: git config --global core.autocrlf false
- run: |
sh -c "uname -a"
echo "$(date -u +"%Y-%m-%d %TZ") - ${{ env.CI_WORKFLOW_NAME }}" # "
git config --global core.autocrlf false
# https://github.com/actions/checkout
- uses: actions/checkout@v3
- uses: actions/checkout@v4
# fetch jslint_ci.sh from trusted source
- run: |
git fetch origin alpha --depth=1
sh -c 'for FILE in .ci.sh .ci2.sh jslint_ci.sh myci2.sh; do
if [ -f "$FILE" ]; then git checkout origin/alpha "$FILE"; fi; done'
# https://github.com/actions/setup-node
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
architecture: ${{ matrix.architecture }}
node-version: ${{ matrix.node_version }}
# run nodejs coverages and tests
- run: sh jslint_ci.sh shCiBase
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ jobs:
- x64
# - x86
node_version:
# - 18
- 20
# - 22
os:
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
- jslint - add new warning requiring paren around plus-separated concatenations.
- jslint - try to improve parser to be able to parse jquery.js without stopping.

# v2024.6.1-beta
- jslint - Remove unnecessary shell-function shCurlExe().
- coverage - Fix coverage-function v8CoverageReportCreate() throwing error EINVAL in latest nodejs-security-patch, when running win32-coverage with npm.cmd.

# v2024.3.26
- ci - Add shell-functions shGitPullrequestCleanup(), shGitPullrequest() to automatically cleanup or create-and-push github-pull-commit to origin/alpha.
- jslint - Allow destructuring-assignment after function-definition.
Expand Down
56 changes: 28 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -917,13 +917,13 @@ eval("1"); //jslint-ignore-line
<br><br>
### pull-request merge
- find highest issue-number at https://github.com/jslint-org/jslint/issues/, https://github.com/jslint-org/jslint/pulls/, and add +1 to it for PR-xxx
- $ `shGitPullrequest beta beta`
- `shGitPullrequest beta beta`
- verify ci-success for origin-branch-alpha
- https://github.com/kaizhu256/jslint/actions/workflows/ci.yml
- $ `git push upstream alpha -f`
- https://github.com/kaizhu256/jslint/actions
- `git push upstream alpha -f`
- verify ci-success for upstream-branch-alpha
- https://github.com/jslint-org/jslint/actions/workflows/ci.yml
- goto https://github.com/jslint-org/jslint/compare/beta...kaizhu256:jslint:branch-p2024.3.21
- https://github.com/jslint-org/jslint/actions
- goto https://github.com/jslint-org/jslint/compare/beta...kaizhu256:jslint:branch-p2024.6.23
- click `Create pull request`
- input `Add your description here...` with:
```
Expand All @@ -945,24 +945,24 @@ this PR will additionally:
- wait awhile before continuing ...
- click `Rebase and merge`
- verify ci-success for upstream-branch-beta
- https://github.com/jslint-org/jslint/actions/workflows/ci.yml
- $ `shGitPullrequestCleanup`
- https://github.com/jslint-org/jslint/actions
- `shGitPullrequestCleanup`
- verify ci-success for origin-branch-alpha
- https://github.com/kaizhu256/jslint/actions/workflows/ci.yml
- $ `git push upstream alpha -f`
- https://github.com/kaizhu256/jslint/actions
- `git push upstream alpha -f`
- verify ci-success for upstream-branch-alpha
- https://github.com/jslint-org/jslint/actions/workflows/ci.yml
- https://github.com/jslint-org/jslint/actions
- click `Delete branch`


<br><br>
### branch-master commit
- $ `shGitPullrequest master beta`
- `shGitPullrequest master beta`
- verify ci-success for origin-branch-alpha
- https://github.com/kaizhu256/jslint/actions/workflows/ci.yml
- $ `git push upstream alpha -f`
- https://github.com/kaizhu256/jslint/actions
- `git push upstream alpha -f`
- verify ci-success for upstream-branch-alpha
- https://github.com/jslint-org/jslint/actions/workflows/ci.yml
- https://github.com/jslint-org/jslint/actions
- goto https://github.com/jslint-org/jslint/compare/beta...kaizhu256:jslint:branch-v2024.3.26
- click `Create pull request`
- input `Add a title` with: `# v20yy.mm.dd`
Expand All @@ -978,27 +978,27 @@ this PR will additionally:
- wait awhile before continuing ...
- click `Rebase and merge`
- verify ci-success for upstream-branch-beta
- https://github.com/jslint-org/jslint/actions/workflows/ci.yml
- $ `shGitPullrequestCleanup`
- https://github.com/jslint-org/jslint/actions
- `shGitPullrequestCleanup`
- verify ci-success for origin-branch-alpha
- https://github.com/kaizhu256/jslint/actions/workflows/ci.yml
- $ `git push upstream alpha -f`
- https://github.com/kaizhu256/jslint/actions
- `git push upstream alpha -f`
- verify ci-success for upstream-branch-alpha
- https://github.com/jslint-org/jslint/actions/workflows/ci.yml
- https://github.com/jslint-org/jslint/actions
- click `Delete branch`
- $ `git push origin beta:master`
- `git push origin beta:master`
- verify ci-success for origin-branch-master
- https://github.com/kaizhu256/jslint/actions/workflows/ci.yml
- $ `git push upstream beta:master`
- https://github.com/kaizhu256/jslint/actions
- `git push upstream beta:master`
- verify ci-success for upstream-branch-master
- https://github.com/jslint-org/jslint/actions/workflows/ci.yml
- https://github.com/jslint-org/jslint/actions


<br><br>
### branch-master publish
- $ `git push upstream beta:master`
- `git push upstream beta:master`
- verify ci-success for upstream-branch-master
- https://github.com/jslint-org/jslint/actions/workflows/ci.yml
- https://github.com/jslint-org/jslint/actions
- goto https://github.com/jslint-org/jslint/releases/new
- input `Choose a tag` with: `v20yy.mm.dd`
- click `Create new tag: v20yy.mm.dd on publish`
Expand All @@ -1016,18 +1016,18 @@ this PR will additionally:
- click `Preview` and review
- click `Publish release`
- verify ci-success for upstream-branch-publish
- https://github.com/jslint-org/jslint/actions/workflows/ci.yml
- https://github.com/jslint-org/jslint/actions
- verify email-notification `Successfully published @jslint-org/jslint@20yy.mm.dd`


<br><br>
### vscode-jslint publish
- goto https://github.com/jslint-org/jslint/tree/gh-pages/branch-beta/.artifact/jslint_wrapper_vscode
- click `vscode-jslint-20yy.mm.dd.vsix`
- click `Download`
- click `Raw` to download
- goto https://marketplace.visualstudio.com/manage/publishers/jslint
- right-click `Update`
- drag-and-drop downloaded `vscode-jslint-20yy.mm.dd.vsix`
- upload downloaded file `vscode-jslint-20yy.mm.dd.vsix`
- click 'Upload'
- verify email-notification `[Succeeded] Extension publish on Visual Studio Marketplace - vscode-jslint`

Expand Down
37 changes: 25 additions & 12 deletions jslint.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@
process_env, process_exit, promises, property, property_dict, push, quote,
ranges, readFile, readdir, readonly, recursive, reduce, repeat, replace,
resolve, result, reverse, role, round, scriptId, search, set, shebang,
shift, signature, single, slice, some, sort, source, spawn, splice, split,
stack, stack_trace, start, startOffset, startsWith, statement,
shell, shift, signature, single, slice, some, sort, source, spawn, splice,
split, stack, stack_trace, start, startOffset, startsWith, statement,
statement_prv, stdio, stop, stop_at, stringify, subscript, switch,
syntax_dict, tenure, test, test_cause, test_internal_error, this, thru,
toLocaleString, toString, token, token_global, token_list, token_nxt,
Expand Down Expand Up @@ -163,7 +163,7 @@ let jslint_charset_ascii = (
+ "@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_"
+ "`abcdefghijklmnopqrstuvwxyz{|}~\u007f"
);
let jslint_edition = "v2024.3.26";
let jslint_edition = "v2024.6.1-beta";
let jslint_export; // The jslint object to be exported.
let jslint_fudge = 1; // Fudge starting line and starting
// ... column to 1.
Expand Down Expand Up @@ -11285,24 +11285,37 @@ function sentinel() {}
}
}));
exitCode = await new Promise(function (resolve) {
moduleChildProcess.spawn(
(
processArgv[0] === "npm"
let processArgv0 = processArgv[0];

// If win32 environment, then replace program npm with npm.cmd.
// Coverage-hack - Ugly-hack to get test-coverage under both win32 and linux.

? process.platform.replace("win32", "npm.cmd").replace(
process.platform,
"npm"
)
: processArgv[0]
),
if (processArgv0 === "npm") {
processArgv0 = process.platform.replace(
"win32",
"npm.cmd"
).replace(
process.platform,
"npm"
);
}
moduleChildProcess.spawn(
processArgv0,
processArgv.slice(1),
{
env: Object.assign({}, process.env, {
NODE_V8_COVERAGE: coverageDir
}),

// PR-465
// https://nodejs.org/en/blog/vulnerability/april-2024-security-releases-2
// Node.js will now error with EINVAL if a .bat or .cmd file is passed to
// child_process.spawn and child_process.spawnSync without the shell option set.

shell: (
processArgv0.endsWith(".bat")
|| processArgv0.endsWith(".cmd")
),
stdio: ["ignore", 1, 2]
}
).on("exit", resolve);
Expand Down
Loading