Add a js_setreport callback function to report warnings.

Don't print error and warning messages directly to stderr.
This commit is contained in:
Tor Andersson
2017-05-16 12:03:38 +02:00
parent 50281c9cee
commit fb32b5c893
7 changed files with 41 additions and 11 deletions
+2 -2
View File
@@ -255,7 +255,7 @@ int js_dostring(js_State *J, const char *source);
<p>
Compile and execute the script in the zero-terminated string in source argument.
If any errors occur, print the error message to stderr and return 1.
If any errors occur, call the report callback function and return 1.
Return 0 on success.
<pre>
@@ -264,7 +264,7 @@ int js_dofile(js_State *J, const char *filename);
<p>
Load the script from the file with the given filename, then compile and execute it.
If any errors occur, print the error message to stderr and return 1.
If any errors occur, call the report callback function and return 1.
Return 0 on success.
<h3>Protected environments</h3>