patch 8.2.4556: test fails without the +job or +channel feature v8.2.4556
authorBram Moolenaar <Bram@vim.org>
Sun, 13 Mar 2022 13:12:27 +0000 (13:12 +0000)
committerBram Moolenaar <Bram@vim.org>
Sun, 13 Mar 2022 13:12:27 +0000 (13:12 +0000)
Problem:    Test fails without the +job or +channel feature. (Dominique Pellé)
Solution:   Adjust #ifdefs.  Pass on skip flag. (closes #9942)

src/eval.c
src/version.c
src/vim9compile.c

index 1d57c38aa0d025465d86c250001239ee28a3ae00..3ecbf6546fd66ea3a9a9491df3b6a9ea223191ed 100644 (file)
@@ -3515,15 +3515,18 @@ handle_predefined(char_u *s, int len, typval_T *rettv)
                    return OK;
                }
                break;
-#ifdef FEAT_JOB_CHANNEL
        case 8: if (STRNCMP(s, "null_job", 8) == 0)
                {
+#ifdef FEAT_JOB_CHANNEL
                    rettv->v_type = VAR_JOB;
                    rettv->vval.v_job = NULL;
+#else
+                   rettv->v_type = VAR_SPECIAL;
+                   rettv->vval.v_number = VVAL_NULL;
+#endif
                    return OK;
                }
                break;
-#endif
        case 9:
                if (STRNCMP(s, "null_", 5) != 0)
                    break;
@@ -3554,14 +3557,17 @@ handle_predefined(char_u *s, int len, typval_T *rettv)
                }
                break;
        case 12:
-#ifdef FEAT_JOB_CHANNEL
                if (STRNCMP(s, "null_channel", 12) == 0)
                {
+#ifdef FEAT_JOB_CHANNEL
                    rettv->v_type = VAR_CHANNEL;
                    rettv->vval.v_channel = NULL;
+#else
+                   rettv->v_type = VAR_SPECIAL;
+                   rettv->vval.v_number = VVAL_NULL;
+#endif
                    return OK;
                }
-#endif
                if (STRNCMP(s, "null_partial", 12) == 0)
                {
                    rettv->v_type = VAR_PARTIAL;
index 20b5a03a3c0adc6727304042d01868dbd2a41133..ac3be8b115cbf4dbccbdffc856adf100d8522579 100644 (file)
@@ -750,6 +750,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    4556,
 /**/
     4555,
 /**/
index 25376d0526e4fd3eb3fa878d7de4d2f9cf28836d..696301f0f2c14b684a2d79608238845282fa8234 100644 (file)
@@ -762,6 +762,7 @@ fill_exarg_from_cctx(exarg_T *eap, cctx_T *cctx)
 {
     eap->getline = exarg_getline;
     eap->cookie = cctx;
+    eap->skip = cctx->ctx_skip == SKIP_YES;
 }
 
 /*
@@ -855,7 +856,8 @@ compile_nested_function(exarg_T *eap, cctx_T *cctx, garray_T *lines_to_free)
        semsg(_(e_namespace_not_supported_str), name_start);
        return NULL;
     }
-    if (check_defined(name_start, name_end - name_start, cctx,
+    if (cctx->ctx_skip != SKIP_YES
+           && check_defined(name_start, name_end - name_start, cctx,
                                                          NULL, FALSE) == FAIL)
        return NULL;
     if (!ASCII_ISUPPER(is_global ? name_start[2] : name_start[0]))