Skip to content

Commit 15f6ea5

Browse files
committed
FIX: APPEND a word on object should set the value to NONE instead of UNSET
related to: metaeducation/rebol-issues#708
1 parent 70a3314 commit 15f6ea5

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

src/core/t-object.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ static void Append_Obj(REBSER *obj, REBVAL *arg)
8383
if ((VAL_WORD_CANON(arg) == SYM_SELF) && !IS_SELFLESS(obj))
8484
Trap0(RE_SELF_PROTECTED);
8585
Expand_Frame(obj, 1, 1); // copy word table also
86-
Append_Frame(obj, 0, VAL_WORD_SYM(arg));
87-
// val is UNSET
86+
val = Append_Frame(obj, 0, VAL_WORD_SYM(arg));
87+
SET_NONE(val);
8888
}
8989
return;
9090
}

src/tests/units/object-test.r3

+14
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,18 @@ Rebol [
3939

4040
===end-group===
4141

42+
===start-group=== "APPEND on OBJECT"
43+
;@@ https://github.com/rebol/rebol-issues/issues/708
44+
--test-- "issue-708"
45+
o: object []
46+
append o 'x
47+
--assert none? o/x
48+
append o [y]
49+
--assert none? o/y
50+
append o [x: 1 y: 2]
51+
--assert o/x = 1
52+
--assert o/y = 2
53+
54+
===end-group===
55+
4256
~~~end-file~~~

0 commit comments

Comments
 (0)