Something went wrong. Try again.
MIRROR: javascript for 🐜's, a tiny runtime with big ambitions ant.themackabu.dev
Something went wrong. Try again.
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758#ifndef ESM_LOADER_H#define ESM_LOADER_H
#include "types.h"
#include <stddef.h>#include <stdbool.h>
typedef enum { MODULE_EVAL_FORMAT_UNKNOWN = 0, MODULE_EVAL_FORMAT_ESM, MODULE_EVAL_FORMAT_CJS,} ant_module_format_t;
typedef struct ant_module_t { ant_value_t module_ns; ant_value_t module_ctx; ant_value_t prev_import_meta_prop; ant_module_format_t format; struct ant_module_t *prev;} ant_module_t;
void js_esm_cleanup_module_cache(ant_t *js);
ant_value_t js_esm_make_file_url(ant_t *js, const char *path);const char *esm_platform_condition(ant_t *js);ant_value_t js_esm_import_sync(ant_t *js, ant_value_t specifier);
ant_value_t js_esm_import_sync_cstr(ant_t *js, const char *specifier, size_t spec_len);ant_value_t js_esm_import_sync_from(ant_t *js, ant_value_t specifier, const char *base_path);ant_value_t js_esm_resolve_specifier(ant_t *js, ant_value_t specifier, const char *base_path);
ant_value_t js_esm_import_sync_from_require(ant_t *js, ant_value_t specifier, const char *base_path);ant_value_t js_esm_resolve_specifier_require(ant_t *js, ant_value_t specifier, const char *base_path);
char *esm_make_absolute_path(const char *path);char *esm_file_url_to_path(ant_t *js, const char *specifier);ant_value_t esm_node_module_paths(ant_t *js, const char *directory);char *js_esm_resolve_path_for_watch(ant_t *js, const char *specifier, const char *base_path, bool prefer_require);
ant_value_t js_esm_import_sync_cstr_from(ant_t *js, const char *specifier, size_t spec_len, const char *base_path);ant_value_t js_esm_import_dynamic(ant_t *js, ant_value_t specifier, const char *base_path, ant_value_t *out_tla_promise);ant_value_t js_esm_import_sync_cstr_from_require(ant_t *js, const char *specifier, size_t spec_len, const char *base_path);ant_value_t js_esm_eval_module_source(ant_t *js, const char *resolved_path, const char *js_code, size_t js_len, ant_value_t ns);ant_value_t js_esm_import_dynamic_ex(ant_t *js, ant_value_t specifier, const char *base_path, ant_value_t attrs, ant_value_t *out_tla_promise);
bool js_esm_is_node_builtin(const char *specifier, size_t spec_len);ant_value_t js_esm_load_node_builtin(ant_t *js, const char *specifier, size_t spec_len, bool *found);
struct ant_bundle;#define ANT_INTERNAL_RUN_ENV "ANT_INTERNAL_RUN"
bool js_esm_bundle_active(ant_t *js);const struct ant_bundle *js_esm_bundle(ant_t *js);bool js_esm_bundle_activate(ant_t *js, const struct ant_bundle *bundle);
#endif