shithub: libmujs

Download patch

ref: 7159bcd774d074453268bc227cd971ab189b30b5
parent: f52bbd89be80cfecc6eebeb05b3817c2b0bc49e5
author: Tor Andersson <tor@ccxvii.net>
date: Sat Jan 25 10:00:29 EST 2014

Make sure to pop error object when we catch them at the top level dofile call.

--- a/jsstate.c
+++ b/jsstate.c
@@ -73,6 +73,7 @@
 {
 	if (js_try(J)) {
 		fprintf(stderr, "libjs: %s\n", js_tostring(J, -1));
+		js_pop(J, 1);
 		return 1;
 	}
 	js_loadstring(J, "(string)", source);
@@ -89,6 +90,7 @@
 {
 	if (js_try(J)) {
 		fprintf(stderr, "libjs: %s\n", js_tostring(J, -1));
+		js_pop(J, 1);
 		return 1;
 	}
 	js_loadfile(J, filename);