From c113df1bb8a0c7d0c560ad32c0291c918c7da7b4 Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Thu, 6 Dec 2018 23:05:36 -0500 Subject: 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. --- libdeno/deno.h | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'libdeno/deno.h') 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); -- cgit v1.2.3