@@ -78,25 +78,6 @@ const protocolHandlers = {
7878 'node:' ( ) { return 'builtin' ; } ,
7979} ;
8080
81- function getFormatFromImportAttributes ( importAttributes ) {
82- if (
83- ! importAttributes ||
84- ! ObjectPrototypeHasOwnProperty ( importAttributes , 'type' ) ||
85- typeof importAttributes . type !== 'string'
86- ) {
87- return undefined ;
88- }
89-
90- if (
91- getOptionValue ( '--experimental-import-text' ) &&
92- importAttributes . type === 'text'
93- ) {
94- return 'text' ;
95- }
96-
97- return undefined ;
98- }
99-
10081/**
10182 * Determine whether the given ambiguous source contains CommonJS or ES module syntax.
10283 * @param {string | Buffer | undefined } [source]
@@ -261,11 +242,6 @@ function getFileProtocolModuleFormat(url, context = { __proto__: null }, ignoreE
261242 * @returns {Promise<string> | string | undefined } only works when enabled
262243 */
263244function defaultGetFormatWithoutErrors ( url , context ) {
264- const format = getFormatFromImportAttributes ( context ?. importAttributes ) ;
265- if ( format !== undefined ) {
266- return format ;
267- }
268-
269245 const protocol = url . protocol ;
270246 if ( ! ObjectPrototypeHasOwnProperty ( protocolHandlers , protocol ) ) {
271247 return null ;
@@ -279,11 +255,6 @@ function defaultGetFormatWithoutErrors(url, context) {
279255 * @returns {Promise<string> | string | undefined } only works when enabled
280256 */
281257function defaultGetFormat ( url , context ) {
282- const format = getFormatFromImportAttributes ( context ?. importAttributes ) ;
283- if ( format !== undefined ) {
284- return format ;
285- }
286-
287258 const protocol = url . protocol ;
288259 if ( ! ObjectPrototypeHasOwnProperty ( protocolHandlers , protocol ) ) {
289260 return null ;
0 commit comments