From 5b94e2bcdb7e8889e620d8aa863b6cae81954992 Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Tue, 7 Mar 2023 11:32:47 +0100 Subject: [PATCH] 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 Reviewed-By: Moshe Atlow Reviewed-By: Jacob Smith Reviewed-By: Geoffrey Booth Reviewed-By: Luigi Pinca --- lib/internal/modules/esm/assert.js | 4 ++-- 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 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/lib/internal/modules/esm/assert.js b/lib/internal/modules/esm/assert.js index 6f2be443c195d1..b1267a10a7a6b2 100644 --- a/lib/internal/modules/esm/assert.js +++ b/lib/internal/modules/esm/assert.js @@ -62,8 +62,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', ); 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.' );