shithub: libmujs

Download patch

ref: 8f87c0a8429785a473e4e98054a32ae3c721df07
parent: 422343489694025b3ccddd6253cb69ec5f483d64
author: Tor Andersson <tor@ccxvii.net>
date: Thu Mar 13 10:41:14 EDT 2014

Parse 0X1234 as hexadecimal numbers in ToNumber.

--- a/jsvalue.c
+++ b/jsvalue.c
@@ -149,7 +149,7 @@
 	char *e;
 	double n;
 	while (jsY_iswhite(*s) || jsY_isnewline(*s)) ++s;
-	if (s[0] == '0' && s[1] == 'x' && s[2] != 0)
+	if (s[0] == '0' && (s[1] == 'x' || s[1] == 'X') && s[2] != 0)
 		n = strtol(s + 2, &e, 16);
 	else if (!strncmp(s, "Infinity", 8))
 		n = INFINITY, e = (char*)s + 8;