summaryrefslogtreecommitdiff
path: root/core/libdeno/deno.h
diff options
context:
space:
mode:
authorBert Belder <bertbelder@gmail.com>2019-07-23 21:12:49 +0200
committerBert Belder <bertbelder@gmail.com>2019-07-24 01:57:32 +0200
commit1406961d2b32b6ff9d842e13d2add124b7e3119d (patch)
tree227956a5c1d83c6eed89f89d8158518484906a0e /core/libdeno/deno.h
parente49d1e16ca2fca45e959c1add9b5a1d6866dbb90 (diff)
Add error handling for dynamic imports to libdeno (#2678)
Diffstat (limited to 'core/libdeno/deno.h')
-rw-r--r--core/libdeno/deno.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/core/libdeno/deno.h b/core/libdeno/deno.h
index 745285554..fe5214848 100644
--- a/core/libdeno/deno.h
+++ b/core/libdeno/deno.h
@@ -36,7 +36,7 @@ typedef void (*deno_recv_cb)(void* user_data, deno_buf control_buf,
typedef int deno_dyn_import_id;
// Called when dynamic import is called in JS: import('foo')
-// Embedder must call deno_dyn_import() with the specified id and
+// Embedder must call deno_dyn_import_done() with the specified id and
// the module.
typedef void (*deno_dyn_import_cb)(void* user_data, const char* specifier,
const char* referrer, deno_dyn_import_id id);
@@ -127,8 +127,12 @@ void deno_mod_evaluate(Deno* d, void* user_data, deno_mod id);
// Call exactly once for every deno_dyn_import_cb.
// Note this call will execute JS.
-void deno_dyn_import(Deno* d, void* user_data, deno_dyn_import_id id,
- deno_mod mod_id);
+// Either mod_id is zero and error_str is not null OR mod_id is valid and
+// error_str is null.
+// TODO(ry) The errors arising from dynamic import are not exactly the same as
+// those arising from ops in Deno.
+void deno_dyn_import_done(Deno* d, void* user_data, deno_dyn_import_id id,
+ deno_mod mod_id, const char* error_str);
#ifdef __cplusplus
} // extern "C"