shithub: libmujs

Download patch

ref: 625542e463a8b100eed2272c0f2e4296485764c6
parent: 7ebc570d01d2f503ad42e5b77d46fd47db3aeb95
author: isRyven <ryven.mt@gmail.com>
date: Tue Mar 17 12:16:09 EDT 2020

fix split doesn't convert context to string if no argument is passed

--- a/jsstring.c
+++ b/jsstring.c
@@ -665,7 +665,7 @@
 {
 	if (js_isundefined(J, 1)) {
 		js_newarray(J);
-		js_copy(J, 0);
+		js_pushstring(J, js_tostring(J, 0));
 		js_setindex(J, -2, 0);
 	} else if (js_isregexp(J, 1)) {
 		Sp_split_regexp(J);