shithub: libmujs

Download patch

ref: d63cf4a906c9919bdfe2d32b7baf9c6acd00f06b
parent: ac9de3c67bc6c8985c1a417c3fde76f4ce7db515
author: Tor Andersson <tor.andersson@artifex.com>
date: Wed Nov 15 10:10:33 EST 2017

Throw a TypeError when converting an object without toString and valueOf.

--- a/jsvalue.c
+++ b/jsvalue.c
@@ -109,6 +109,9 @@
 		}
 	}
 
+	if (J->strict)
+		js_typeerror(J, "cannot convert object to primitive");
+
 	v->type = JS_TLITSTR;
 	v->u.litstr = "[object]";
 	return;