Files
node/lib
Joyee Cheung 651fa047c1 module: detect ESM syntax by trying to recompile as SourceTextModule
Instead of using an async function wrapper, just try compiling code with
unknown module format as SourceTextModule when it cannot be compiled
as CJS and the error message indicates that it's worth a retry. If
it can be parsed as SourceTextModule then it's considered ESM.

Also, move shouldRetryAsESM() to C++ completely so that
we can reuse it in the CJS module loader for require(esm).

Drive-by: move methods that don't belong to ContextifyContext
out as static methods and move GetHostDefinedOptions to
ModuleWrap.

PR-URL: https://github.com/nodejs/node/pull/52413
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
Reviewed-By: Jacob Smith <jacob@frende.me>
2024-04-19 14:29:08 +00:00
..
2023-11-11 16:25:08 +00:00
2024-03-16 09:08:56 +00:00
2024-01-12 16:09:48 +00:00
2023-11-11 16:25:08 +00:00
2024-02-02 15:25:34 +01:00
2024-03-20 17:27:29 +00:00
2024-03-19 15:38:17 +00:00
2023-12-23 10:23:43 +00:00
2023-11-11 16:25:08 +00:00