@@ -629,10 +629,10 @@ static void f_job_stop(typval_T *argvars, typval_T *rettv);
629629static void f_job_status(typval_T *argvars, typval_T *rettv);
630630#endif
631631static void f_join(typval_T *argvars, typval_T *rettv);
632- static void f_jsdecode (typval_T *argvars, typval_T *rettv);
633- static void f_jsencode (typval_T *argvars, typval_T *rettv);
634- static void f_jsondecode (typval_T *argvars, typval_T *rettv);
635- static void f_jsonencode (typval_T *argvars, typval_T *rettv);
632+ static void f_js_decode (typval_T *argvars, typval_T *rettv);
633+ static void f_js_encode (typval_T *argvars, typval_T *rettv);
634+ static void f_json_decode (typval_T *argvars, typval_T *rettv);
635+ static void f_json_encode (typval_T *argvars, typval_T *rettv);
636636static void f_keys(typval_T *argvars, typval_T *rettv);
637637static void f_last_buffer_nr(typval_T *argvars, typval_T *rettv);
638638static void f_len(typval_T *argvars, typval_T *rettv);
@@ -8213,10 +8213,10 @@ static struct fst
82138213 {"job_stop", 1, 2, f_job_stop},
82148214#endif
82158215 {"join", 1, 2, f_join},
8216- {"jsdecode ", 1, 1, f_jsdecode },
8217- {"jsencode ", 1, 1, f_jsencode },
8218- {"jsondecode ", 1, 1, f_jsondecode },
8219- {"jsonencode ", 1, 1, f_jsonencode },
8216+ {"js_decode ", 1, 1, f_js_decode },
8217+ {"js_encode ", 1, 1, f_js_encode },
8218+ {"json_decode ", 1, 1, f_json_decode },
8219+ {"json_encode ", 1, 1, f_json_encode },
82208220 {"keys", 1, 1, f_keys},
82218221 {"last_buffer_nr", 0, 0, f_last_buffer_nr},/* obsolete */
82228222 {"len", 1, 1, f_len},
@@ -9871,12 +9871,13 @@ f_ch_open(typval_T *argvars, typval_T *rettv)
98719871
98729872 if (argvars[1].v_type == VAR_DICT)
98739873 {
9874- /* parse argdict */
9875- dict_T *dict = argvars[1].vval.v_dict ;
9874+ dict_T *dict = argvars[1].vval.v_dict;
9875+ dictitem_T *item ;
98769876
9877- if (dict_find(dict, (char_u *)"mode", -1) != NULL)
9877+ /* parse argdict */
9878+ if ((item = dict_find(dict, (char_u *)"mode", -1)) != NULL)
98789879 {
9879- mode = get_dict_string(dict, (char_u *)"mode", FALSE );
9880+ mode = get_tv_string(&item->di_tv );
98809881 if (STRCMP(mode, "raw") == 0)
98819882 ch_mode = MODE_RAW;
98829883 else if (STRCMP(mode, "js") == 0)
@@ -9889,12 +9890,12 @@ f_ch_open(typval_T *argvars, typval_T *rettv)
98899890 return;
98909891 }
98919892 }
9892- if (dict_find(dict, (char_u *)"waittime", -1) != NULL)
9893- waittime = get_dict_number(dict, (char_u *)"waittime" );
9894- if (dict_find(dict, (char_u *)"timeout", -1) != NULL)
9895- timeout = get_dict_number(dict, (char_u *)"timeout" );
9896- if (dict_find(dict, (char_u *)"callback", -1) != NULL)
9897- callback = get_dict_string(dict, (char_u *)"callback", FALSE );
9893+ if ((item = dict_find(dict, (char_u *)"waittime", -1) ) != NULL)
9894+ waittime = get_tv_number(&item->di_tv );
9895+ if ((item = dict_find(dict, (char_u *)"timeout", -1) ) != NULL)
9896+ timeout = get_tv_number(&item->di_tv );
9897+ if ((item = dict_find(dict, (char_u *)"callback", -1) ) != NULL)
9898+ callback = get_callback(&item->di_tv );
98989899 }
98999900 if (waittime < 0 || timeout < 0)
99009901 {
@@ -14506,10 +14507,10 @@ f_join(typval_T *argvars, typval_T *rettv)
1450614507}
1450714508
1450814509/*
14509- * "jsdecode ()" function
14510+ * "js_decode ()" function
1451014511 */
1451114512 static void
14512- f_jsdecode (typval_T *argvars, typval_T *rettv)
14513+ f_js_decode (typval_T *argvars, typval_T *rettv)
1451314514{
1451414515 js_read_T reader;
1451514516
@@ -14521,20 +14522,20 @@ f_jsdecode(typval_T *argvars, typval_T *rettv)
1452114522}
1452214523
1452314524/*
14524- * "jsencode ()" function
14525+ * "js_encode ()" function
1452514526 */
1452614527 static void
14527- f_jsencode (typval_T *argvars, typval_T *rettv)
14528+ f_js_encode (typval_T *argvars, typval_T *rettv)
1452814529{
1452914530 rettv->v_type = VAR_STRING;
1453014531 rettv->vval.v_string = json_encode(&argvars[0], JSON_JS);
1453114532}
1453214533
1453314534/*
14534- * "jsondecode ()" function
14535+ * "json_decode ()" function
1453514536 */
1453614537 static void
14537- f_jsondecode (typval_T *argvars, typval_T *rettv)
14538+ f_json_decode (typval_T *argvars, typval_T *rettv)
1453814539{
1453914540 js_read_T reader;
1454014541
@@ -14546,10 +14547,10 @@ f_jsondecode(typval_T *argvars, typval_T *rettv)
1454614547}
1454714548
1454814549/*
14549- * "jsonencode ()" function
14550+ * "json_encode ()" function
1455014551 */
1455114552 static void
14552- f_jsonencode (typval_T *argvars, typval_T *rettv)
14553+ f_json_encode (typval_T *argvars, typval_T *rettv)
1455314554{
1455414555 rettv->v_type = VAR_STRING;
1455514556 rettv->vval.v_string = json_encode(&argvars[0], 0);
@@ -21649,7 +21650,7 @@ get_tv_string_buf_chk(typval_T *varp, char_u *buf)
2164921650 "process %ld %s", (long)job->jv_pid, status);
2165021651# elif defined(WIN32)
2165121652 vim_snprintf((char *)buf, NUMBUFLEN,
21652- "process %ld %s", (long)job->jf_pi .dwProcessId,
21653+ "process %ld %s", (long)job->jv_pi .dwProcessId,
2165321654 status);
2165421655# else
2165521656 /* fall-back */
0 commit comments