Mercurial > vim
comparison src/eval.c @ 20401:918b9a05cf35 v8.2.0755
patch 8.2.0755: Vim9: No error when variable initializer is not a constant
Commit: https://github.com/vim/vim/commit/227a69de1e0f9457a9fc9e098d999304faff55f8
Author: Bram Moolenaar <Bram@vim.org>
Date: Fri May 15 18:17:28 2020 +0200
patch 8.2.0755: Vim9: No error when variable initializer is not a constant
Problem: Vim9: No error when variable initializer is not a constant.
Solution: Return FAIL when trying to get a variable value. Do not execute a
script when an error is deteted in the first or second phase.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Fri, 15 May 2020 18:30:04 +0200 |
parents | c225be44692a |
children | 5950284a517f |
comparison
equal
deleted
inserted
replaced
20400:9a53e38d4abb | 20401:918b9a05cf35 |
---|---|
2693 ret = FAIL; | 2693 ret = FAIL; |
2694 else | 2694 else |
2695 { | 2695 { |
2696 if (**arg == '(') // recursive! | 2696 if (**arg == '(') // recursive! |
2697 ret = eval_func(arg, s, len, rettv, flags, NULL); | 2697 ret = eval_func(arg, s, len, rettv, flags, NULL); |
2698 else if (flags & EVAL_CONSTANT) | |
2699 ret = FAIL; | |
2698 else if (evaluate) | 2700 else if (evaluate) |
2699 ret = get_var_tv(s, len, rettv, NULL, TRUE, FALSE); | 2701 ret = get_var_tv(s, len, rettv, NULL, TRUE, FALSE); |
2700 else | 2702 else |
2701 { | 2703 { |
2702 check_vars(s, len); | 2704 check_vars(s, len); |