From f16b38e71d0345fa25d616550554ef7ed5370866 Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Mon, 6 Mar 2023 11:47:09 +0100 Subject: [PATCH 1/2] esm: fix import assertion warning Refs: https://github.com/nodejs/node/pull/46901#discussion_r1122242913 --- lib/internal/modules/esm/assert.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/internal/modules/esm/assert.js b/lib/internal/modules/esm/assert.js index 3437aa1a61b86f..45df6781d49497 100644 --- a/lib/internal/modules/esm/assert.js +++ b/lib/internal/modules/esm/assert.js @@ -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', ); From cfe4b319a736cfda8c2333c78d49a124a012e643 Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Mon, 6 Mar 2023 17:37:10 +0100 Subject: [PATCH 2/2] fixup! esm: fix import assertion warning --- test/es-module/test-esm-import-assertion-errors.js | 4 ++-- test/es-module/test-esm-import-assertion-errors.mjs | 4 ++-- test/es-module/test-esm-import-assertion-validation.js | 4 ++-- test/es-module/test-esm-import-assertion-warning.mjs | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/test/es-module/test-esm-import-assertion-errors.js b/test/es-module/test-esm-import-assertion-errors.js index 8d12a2d12b3955..e2abd3fb43976d 100644 --- a/test/es-module/test-esm-import-assertion-errors.js +++ b/test/es-module/test-esm-import-assertion-errors.js @@ -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.' ); diff --git a/test/es-module/test-esm-import-assertion-errors.mjs b/test/es-module/test-esm-import-assertion-errors.mjs index a6be862c49f074..9cc08c06528fc6 100644 --- a/test/es-module/test-esm-import-assertion-errors.mjs +++ b/test/es-module/test-esm-import-assertion-errors.mjs @@ -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.' ); diff --git a/test/es-module/test-esm-import-assertion-validation.js b/test/es-module/test-esm-import-assertion-validation.js index 462f1c527e4b1b..ec2d2a2c08f7b5 100644 --- a/test/es-module/test-esm-import-assertion-validation.js +++ b/test/es-module/test-esm-import-assertion-validation.js @@ -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.' ); diff --git a/test/es-module/test-esm-import-assertion-warning.mjs b/test/es-module/test-esm-import-assertion-warning.mjs index 739d246f620e6f..0b18d8ff9eaf62 100644 --- a/test/es-module/test-esm-import-assertion-warning.mjs +++ b/test/es-module/test-esm-import-assertion-warning.mjs @@ -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.' );