diff --git a/src/core/n-data.c b/src/core/n-data.c index 59555166c7..9231221854 100644 --- a/src/core/n-data.c +++ b/src/core/n-data.c @@ -678,10 +678,11 @@ static int Check_Char_Range(REBVAL *val, REBINT limit) Protected(word); value = Get_Var(word); SET_UNSET(value); - } + } else Trap1(RE_NOT_DEFINED, word); } else { for (word = VAL_BLK_DATA(word); NOT_END(word); word++) { - if (IS_WORD(word) && VAL_WORD_FRAME(word)) { + if (IS_WORD(word)) { + if (!VAL_WORD_FRAME(word)) Trap1(RE_NOT_DEFINED, word); Protected(word); value = Get_Var(word); SET_UNSET(value); diff --git a/src/tests/units/evaluation-test.r3 b/src/tests/units/evaluation-test.r3 index 9b6fff09da..99e337f541 100644 --- a/src/tests/units/evaluation-test.r3 +++ b/src/tests/units/evaluation-test.r3 @@ -379,6 +379,10 @@ Rebol [ ;@@ https://github.com/Oldes/Rebol-issues/issues/2003 --assert none? to-value #[unset!] --assert integer? to-value 1 + + --test-- "unset unbind 'x" + ;@@ https://github.com/Oldes/Rebol-issues/issues/2219 + --assert error? try [unset unbind 'x] ===end-group===