Skip to content

Commit 14061be

Browse files
committed
Merge branch 'v4-hotfix'
2 parents f4067b2 + 7c48c4d commit 14061be

File tree

7 files changed

+56
-295
lines changed

7 files changed

+56
-295
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
node-version: ${{ matrix.node-version }}
3030
cache: npm
3131
- name: Upgrade npm
32-
run: npm install --global npm@^8.12
32+
run: npm install --global npm@^8.18
3333
- run: npm install --no-audit
3434
- run: npm run cover
3535
- uses: codecov/codecov-action@v2
@@ -50,7 +50,7 @@ jobs:
5050
node-version: ^18
5151
cache: npm
5252
- name: Upgrade npm
53-
run: npm install --global npm@^8.12
53+
run: npm install --global npm@^8.18
5454
- run: npm install --no-audit
5555
- run: npm i typescript@${TS_VERSION}
5656
env:
@@ -68,7 +68,7 @@ jobs:
6868
node-version: ^18
6969
cache: npm
7070
- name: Upgrade npm
71-
run: if [[ "$(npm -v)" != "8.12.0" ]]; then npm install --global npm@8.12.0; fi
71+
run: if [[ "$(npm -v)" != "8.18.0" ]]; then npm install --global npm@8.18.0; fi
7272
- run: npm install --no-audit
7373
- name: Test package-lock for unexpected modifications
7474
run: |
@@ -89,7 +89,7 @@ jobs:
8989
with:
9090
node-version: ^18
9191
- name: Upgrade npm
92-
run: npm install --global npm@^8.12
92+
run: npm install --global npm@^8.18
9393
- run: npm install --no-package-lock --no-audit
9494
- run: npm run cover
9595

@@ -103,6 +103,6 @@ jobs:
103103
node-version: ^18
104104
cache: npm
105105
- name: Upgrade npm
106-
run: npm install --global npm@^8.12
106+
run: npm install --global npm@^8.18
107107
- run: npm install --no-audit
108108
- run: npx xo

.xo-config.cjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ module.exports = {
3636
{
3737
files: 'examples/**',
3838
rules: {
39+
'ava/no-ignored-test-files': 'off',
3940
'ava/no-only-test': 'off',
4041
'unicorn/prefer-module': 'off',
4142
},

lib/worker/line-numbers.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ function findTest(locations, declaration) {
6161
const range = (start, end) => Array.from({length: end - start + 1}).fill(start).map((element, index) => element + index);
6262

6363
const translate = (sourceMap, pos) => {
64-
if (sourceMap === undefined) {
64+
if (sourceMap === null) {
6565
return pos;
6666
}
6767

@@ -88,7 +88,7 @@ export default function lineNumberSelection({file, lineNumbers = []}) {
8888

8989
let locations = parse(file);
9090
let lookedForSourceMap = false;
91-
let sourceMap;
91+
let sourceMap = null;
9292

9393
return () => {
9494
if (!lookedForSourceMap) {
@@ -98,7 +98,13 @@ export default function lineNumberSelection({file, lineNumbers = []}) {
9898
// Source maps are not available before then.
9999
sourceMap = findSourceMap(file);
100100

101-
if (sourceMap !== undefined) {
101+
if (sourceMap === undefined) {
102+
// Prior to Node.js 18.8.0, the value when a source map could not be found was `undefined`.
103+
// This changed to `null` in <https://github.com/nodejs/node/pull/43875>.
104+
sourceMap = null;
105+
}
106+
107+
if (sourceMap !== null) {
102108
locations = locations.map(({start, end}) => ({
103109
start: translate(sourceMap, start),
104110
end: translate(sourceMap, end),

0 commit comments

Comments
 (0)