✔ abstract_syntax_tree
✔ abstract_syntax_tree_location_data
✔ argument_parsing
✔ arrays
✔ assignment
✔ async
✔ async_iterators
✔ booleans
✔ classes
✔ cluster
✔ comments
✔ compilation
✔ comprehensions
✔ control_flow
✔ error_messages
✔ eval
✔ exception_handling
✔ exponentiation
✔ formatting
✔ function_invocation
✔ functions
✔ generators
✔ helpers
✔ import_assertions
✔ importing
✔ interpolation
✔ invocation_argument_parsing
✔ javascript_literals
✔ jsx
✔ literate
✔ literate_tabbed
✔ location
✔ modules
✔ numbers
✔ numbers_bigint
✔ numeric_literal_separators
✔ object_rest_spread
✔ objects
✔ operators
✔ option_parser
✔ package
✔ parser
✔ ranges
✔ regex
✔ regex_dotall
✔ repl
✔ scope
✔ slicing_and_splicing
✔ soaks
✔ sourcemap
✔ strict
✔ strings
✔ tagged_template_literals
dynamic import assertion:
async function() {
var exception, secret;
try {
({
default: secret
} = (await import('data:application/json,{"ofLife":42}', {
assert: {
type: 'json'
}
})));
return eq(secret.ofLife, 42);
} catch (error) {
exception = error;
// This parses on Node 16.14.x but throws an error because JSON modules aren’t unflagged there yet; remove this try/catch once the unflagging of `--experimental-json-modules` is backported (see https://github.com/nodejs/node/pull/41736#issuecomment-1086738670)
if (exception.message !== 'Invalid module "data:application/json,{"ofLife":42}" has an unsupported MIME type "application/json"') {
throw exception;
}
}
}
TypeError: Failed to fetch dynamically imported module: data:application/json,{"ofLife":42}
failed 4 tests and passed 1404 tests in 4.36 seconds
assert keyword:
async function() {
var assert, exception;
assert = 1;
try {
({
default: assert
} = (await import('data:application/json,{"thatIAm":42}', {
assert: {
type: 'json'
}
})));
eq(assert.thatIAm, 42);
} catch (error) {
exception = error;
// This parses on Node 16.14.x but throws an error because JSON modules aren’t unflagged there yet; remove this try/catch once the unflagging of `--experimental-json-modules` is backported (see https://github.com/nodejs/node/pull/41736#issuecomment-1086738670)
if (exception.message !== 'Invalid module "data:application/json,{"thatIAm":42}" has an unsupported MIME type "application/json"') {
throw exception;
}
}
return eqJS(`import assert from 'regression-test'`, `import assert from 'regression-test';`);
}
TypeError: Failed to fetch dynamically imported module: data:application/json,{"thatIAm":42}