patch 8.1.0731: JS encoding does not handle negative infinity

Problem:    JS encoding does not handle negative infinity.
Solution:   Add support for negative infinity for JS encoding. (Dominique
            Pelle, closes #3792)
diff --git a/src/json.c b/src/json.c
index 6063771..d9da10d 100644
--- a/src/json.c
+++ b/src/json.c
@@ -316,7 +316,12 @@
 	    if (isnan(val->vval.v_float))
 		ga_concat(gap, (char_u *)"NaN");
 	    else if (isinf(val->vval.v_float))
-		ga_concat(gap, (char_u *)"Infinity");
+	    {
+		if (val->vval.v_float < 0.0)
+		    ga_concat(gap, (char_u *)"-Infinity");
+		else
+		    ga_concat(gap, (char_u *)"Infinity");
+	    }
 	    else
 # endif
 	    {
@@ -736,7 +741,7 @@
 		    break;
 
 		default:
-		    if (VIM_ISDIGIT(*p) || *p == '-')
+		    if (VIM_ISDIGIT(*p) || (*p == '-' && VIM_ISDIGIT(p[1])))
 		    {
 #ifdef FEAT_FLOAT
 			char_u  *sp = p;
@@ -834,6 +839,17 @@
 			retval = OK;
 			break;
 		    }
+		    if (STRNICMP((char *)p, "-Infinity", 9) == 0)
+		    {
+			reader->js_used += 9;
+			if (cur_item != NULL)
+			{
+			    cur_item->v_type = VAR_FLOAT;
+			    cur_item->vval.v_float = -INFINITY;
+			}
+			retval = OK;
+			break;
+		    }
 		    if (STRNICMP((char *)p, "Infinity", 8) == 0)
 		    {
 			reader->js_used += 8;
@@ -851,6 +867,7 @@
 		    if (
 			    (len < 5 && STRNICMP((char *)p, "false", len) == 0)
 #ifdef FEAT_FLOAT
+			    || (len < 9 && STRNICMP((char *)p, "-Infinity", len) == 0)
 			    || (len < 8 && STRNICMP((char *)p, "Infinity", len) == 0)
 			    || (len < 3 && STRNICMP((char *)p, "NaN", len) == 0)
 #endif
@@ -1072,7 +1089,7 @@
  * Return FAIL if the message has a decoding error.
  * Return MAYBE if the message is truncated, need to read more.
  * This only works reliable if the message contains an object, array or
- * string.  A number might be trucated without knowing.
+ * string.  A number might be truncated without knowing.
  * Does not advance the reader.
  */
     int