esm: fix import assertion warning

Refs: https://github.com/nodejs/node/pull/46901#discussion_r1122242913
PR-URL: https://github.com/nodejs/node/pull/46971
Reviewed-By: Debadree Chatterjee <debadree333@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Jacob Smith <jacob@frende.me>
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
This commit is contained in:
Antoine du Hamel
2023-03-07 11:32:47 +01:00
committed by GitHub
parent 68e83901f3
commit 0c4f8f255a
5 changed files with 10 additions and 10 deletions

View File

@@ -61,8 +61,8 @@ function validateAssertions(url, format,
if (!alreadyWarned && ObjectKeys(importAssertions).length !== 0) {
alreadyWarned = true;
process.emitWarning(
'Import assertions are not a stable feature of the JavaScript language, ' +
'avoid relying on their current behavior and syntax as those might change ' +
'Import assertions are not a stable feature of the JavaScript language. ' +
'Avoid relying on their current behavior and syntax as those might change ' +
'in a future version of Node.js.',
'ExperimentalWarning',
);

View File

@@ -7,8 +7,8 @@ const jsonModuleDataUrl = 'data:application/json,""';
common.expectWarning(
'ExperimentalWarning',
'Import assertions are not a stable feature of the JavaScript language, ' +
'avoid relying on their current behavior and syntax as those might change ' +
'Import assertions are not a stable feature of the JavaScript language. ' +
'Avoid relying on their current behavior and syntax as those might change ' +
'in a future version of Node.js.'
);

View File

@@ -6,8 +6,8 @@ const jsonModuleDataUrl = 'data:application/json,""';
expectWarning(
'ExperimentalWarning',
'Import assertions are not a stable feature of the JavaScript language, ' +
'avoid relying on their current behavior and syntax as those might change ' +
'Import assertions are not a stable feature of the JavaScript language. ' +
'Avoid relying on their current behavior and syntax as those might change ' +
'in a future version of Node.js.'
);

View File

@@ -8,8 +8,8 @@ const { validateAssertions } = require('internal/modules/esm/assert');
common.expectWarning(
'ExperimentalWarning',
'Import assertions are not a stable feature of the JavaScript language, ' +
'avoid relying on their current behavior and syntax as those might change ' +
'Import assertions are not a stable feature of the JavaScript language. ' +
'Avoid relying on their current behavior and syntax as those might change ' +
'in a future version of Node.js.'
);

View File

@@ -2,8 +2,8 @@ import { expectWarning } from '../common/index.mjs';
expectWarning(
'ExperimentalWarning',
'Import assertions are not a stable feature of the JavaScript language, ' +
'avoid relying on their current behavior and syntax as those might change ' +
'Import assertions are not a stable feature of the JavaScript language. ' +
'Avoid relying on their current behavior and syntax as those might change ' +
'in a future version of Node.js.'
);