From 15f6ea5f40db98b54d0d75ace4f574f5eaa279c9 Mon Sep 17 00:00:00 2001 From: Oldes Date: Sun, 9 Feb 2020 17:02:32 +0100 Subject: [PATCH] FIX: APPEND a word on object should set the value to NONE instead of UNSET related to: https://github.com/rebol/rebol-issues/issues/708 --- src/core/t-object.c | 4 ++-- src/tests/units/object-test.r3 | 14 ++++++++++++++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/core/t-object.c b/src/core/t-object.c index 043859cd93..9854fb4b5a 100644 --- a/src/core/t-object.c +++ b/src/core/t-object.c @@ -83,8 +83,8 @@ static void Append_Obj(REBSER *obj, REBVAL *arg) if ((VAL_WORD_CANON(arg) == SYM_SELF) && !IS_SELFLESS(obj)) Trap0(RE_SELF_PROTECTED); Expand_Frame(obj, 1, 1); // copy word table also - Append_Frame(obj, 0, VAL_WORD_SYM(arg)); - // val is UNSET + val = Append_Frame(obj, 0, VAL_WORD_SYM(arg)); + SET_NONE(val); } return; } diff --git a/src/tests/units/object-test.r3 b/src/tests/units/object-test.r3 index e8686a0bf1..e8bba46ce5 100644 --- a/src/tests/units/object-test.r3 +++ b/src/tests/units/object-test.r3 @@ -39,4 +39,18 @@ Rebol [ ===end-group=== +===start-group=== "APPEND on OBJECT" + ;@@ https://github.com/rebol/rebol-issues/issues/708 + --test-- "issue-708" + o: object [] + append o 'x + --assert none? o/x + append o [y] + --assert none? o/y + append o [x: 1 y: 2] + --assert o/x = 1 + --assert o/y = 2 + +===end-group=== + ~~~end-file~~~