summaryrefslogtreecommitdiff
path: root/libdeno/deno.h
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2018-12-06 23:05:36 -0500
committerGitHub <noreply@github.com>2018-12-06 23:05:36 -0500
commitc113df1bb8a0c7d0c560ad32c0291c918c7da7b4 (patch)
tree0d15de448be602c22aecb2ec65ac7667c437a209 /libdeno/deno.h
parent568ac0c9026b6f4012e2511a026bb5eb31a06020 (diff)
Process source maps in Rust instead of JS (#1280)
- Improves speed and binary size significantly. - Makes deno_last_exception() output a JSON structure. - Isolate::execute and Isolate::event_loop now return structured, mapped JSError objects on errors. - Removes libdeno functions: libdeno.setGlobalErrorHandler() libdeno.setPromiseRejectHandler() libdeno.setPromiseErrorExaminer() In collaboration with Ryan Dahl.
Diffstat (limited to 'libdeno/deno.h')
-rw-r--r--libdeno/deno.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/libdeno/deno.h b/libdeno/deno.h
index fb0b13746..48356bc86 100644
--- a/libdeno/deno.h
+++ b/libdeno/deno.h
@@ -37,7 +37,7 @@ typedef struct {
Deno* deno_new(deno_buf snapshot, deno_config config);
Deno* deno_new_snapshotter(deno_config config, const char* js_filename,
- const char* js_source, const char* source_map);
+ const char* js_source);
// Generate a snapshot. The resulting buf can be used with deno_new.
// The caller must free the returned data by calling delete[] buf.data_ptr.
@@ -48,6 +48,12 @@ void deno_delete(Deno* d);
// Returns false on error.
// Get error text with deno_last_exception().
// 0 = fail, 1 = success
+//
+// TODO change return value to be const char*. On success the return
+// value is nullptr, on failure it is the JSON exception text that
+// is returned by deno_last_exception(). Remove deno_last_exception().
+// The return string is valid until the next execution of deno_execute or
+// deno_respond (as deno_last_exception is now).
int deno_execute(Deno* d, void* user_data, const char* js_filename,
const char* js_source);
@@ -69,6 +75,12 @@ int deno_execute(Deno* d, void* user_data, const char* js_filename,
//
// A non-zero return value, means a JS exception was encountered during the
// libdeno.recv() callback. Check deno_last_exception() for exception text.
+//
+// TODO change return value to be const char*. On success the return
+// value is nullptr, on failure it is the JSON exception text that
+// is returned by deno_last_exception(). Remove deno_last_exception().
+// The return string is valid until the next execution of deno_execute or
+// deno_respond (as deno_last_exception is now).
int deno_respond(Deno* d, void* user_data, int32_t req_id, deno_buf buf);
void deno_check_promise_errors(Deno* d);