Commit f533e1f4 authored by Andrew Price's avatar Andrew Price
Browse files

js-duk: Set script_output=0 when js_exec'd code throws errors

parent 26c2a8df
Loading
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -704,6 +704,7 @@ int js_exec(char *name, int argc, const char **argv)
		} else {
			fprintf(stderr, "mwjs error: %s\n", duk_safe_to_string(ctx, -1));
		}
		script_output = 0;
	} else if (duk_is_boolean(ctx, -1) && !duk_get_boolean(ctx, -1)) {
		script_output = 0;
	}