Skip to content

Commit

Permalink
CHANGE: appending a word into an object sets its value to unset
Browse files Browse the repository at this point in the history
… instead of `none`

related to: Oldes/Rebol-issues#708
  • Loading branch information
Oldes committed Sep 23, 2021
1 parent ad28197 commit 093728a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/core/t-object.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ static void Append_Obj(REBSER *obj, REBVAL *arg)
Trap0(RE_SELF_PROTECTED);
Expand_Frame(obj, 1, 1); // copy word table also
val = Append_Frame(obj, 0, VAL_WORD_SYM(arg));
SET_NONE(val);
SET_UNSET(val);
}
return;
}
Expand Down Expand Up @@ -150,7 +150,7 @@ static void Append_Obj(REBSER *obj, REBVAL *arg)
Trap0(RE_HIDDEN);
}

if (IS_END(word + 1)) SET_NONE(val);
if (IS_END(word + 1)) SET_UNSET(val);
else *val = word[1];

if (IS_END(word + 1)) break; // fix bug#708
Expand Down
4 changes: 2 additions & 2 deletions src/tests/units/object-test.r3
Original file line number Diff line number Diff line change
Expand Up @@ -246,9 +246,9 @@ Rebol [
--test-- "issue-708"
o: object []
append o 'x
--assert none? o/x
--assert unset? o/x
append o [y]
--assert none? o/y
--assert unset? o/y
--assert object? append o [x: 1 y: 2]
--assert o/x = 1
--assert o/y = 2
Expand Down

0 comments on commit 093728a

Please sign in to comment.