diff options
author | Michael Drake <tlsa@netsurf-browser.org> | 2015-08-13 12:23:59 +0100 |
---|---|---|
committer | Michael Drake <tlsa@netsurf-browser.org> | 2015-08-13 12:23:59 +0100 |
commit | 16fd36eb9d13a71deba2d7a737efa16e1f953138 (patch) | |
tree | 41aabec842296aecf820d3b2cfcd64060357c150 /javascript/js.h | |
parent | c7a32294940c54294b96c0d0d789e0cffb1c03b3 (diff) | |
download | netsurf-16fd36eb9d13a71deba2d7a737efa16e1f953138.tar.gz netsurf-16fd36eb9d13a71deba2d7a737efa16e1f953138.tar.bz2 |
Proper error handling for JS context creation.
Diffstat (limited to 'javascript/js.h')
-rw-r--r-- | javascript/js.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/javascript/js.h b/javascript/js.h index 7102fcf0e..6f7de920f 100644 --- a/javascript/js.h +++ b/javascript/js.h @@ -23,6 +23,9 @@ #ifndef _NETSURF_JAVASCRIPT_JS_H_ #define _NETSURF_JAVASCRIPT_JS_H_ +#include "utils/errors.h" + + typedef struct jscontext jscontext; typedef struct jsobject jsobject; @@ -45,8 +48,11 @@ void js_finalise(void); * \param timeout elapsed wallclock time (in seconds) before \a callback is called * \param cb the callback when the runtime exceeds the timeout * \param cbctx The context to pass to the callback + * \param jsctx Updated to the created JS context + * \return NSERROR_OK on success, appropriate error otherwise. */ -jscontext *js_newcontext(int timeout, jscallback *cb, void *cbctx); +nserror js_newcontext(int timeout, jscallback *cb, void *cbctx, + jscontext **jsctx); /** Destroy a previously created context */ void js_destroycontext(jscontext *ctx); |