Skip to content

Commit

Permalink
fixup: make documentation-only deprecation
Browse files Browse the repository at this point in the history
Co-authored-by: Antoine du Hamel <[email protected]>
  • Loading branch information
guybedford and aduh95 committed Sep 8, 2021
1 parent 266a0a6 commit 5129ba6
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 0 deletions.
6 changes: 6 additions & 0 deletions doc/api/deprecations.md
Original file line number Diff line number Diff line change
Expand Up @@ -2815,6 +2815,12 @@ The `'hash'` and `'mgf1Hash'` options are replaced with `'hashAlgorithm'`
and `'mgf1HashAlgorithm'`.

### DEP0155: Trailing slashes in pattern specifier resolutions
<!-- YAML
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/40039
description: Documentation-only.
-->

Type: Runtime

Expand Down
2 changes: 2 additions & 0 deletions lib/internal/modules/esm/resolve.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ const { sep, relative, resolve } = require('path');
const preserveSymlinks = getOptionValue('--preserve-symlinks');
const preserveSymlinksMain = getOptionValue('--preserve-symlinks-main');
const typeFlag = getOptionValue('--input-type');
const pendingDeprecation = getOptionValue('--pending-deprecation');
const { URL, pathToFileURL, fileURLToPath } = require('internal/url');
const {
ERR_INPUT_TYPE_NOT_ALLOWED,
Expand Down Expand Up @@ -98,6 +99,7 @@ function emitFolderMapDeprecation(match, pjsonUrl, isExports, base) {
}

function emitTrailingSlashPatternDeprecation(match, pjsonUrl, isExports, base) {
if (!pendingDeprecation) return;
const pjsonPath = fileURLToPath(pjsonUrl);
if (emittedPackageWarnings.has(pjsonPath + '|' + match))
return;
Expand Down
1 change: 1 addition & 0 deletions test/es-module/test-esm-exports-deprecations.mjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Flags: --pending-deprecation
import { mustCall } from '../common/index.mjs';
import assert from 'assert';

Expand Down
2 changes: 2 additions & 0 deletions test/es-module/test-esm-local-deprecations.mjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Flags: --pending-deprecation

import '../common/index.mjs';
import assert from 'assert';
import fixtures from '../common/fixtures.js';
Expand Down

0 comments on commit 5129ba6

Please sign in to comment.