1
0
mirror of https://github.com/robertkrimen/otto synced 2025-10-12 20:27:30 +08:00

Make sure delete([].xyzzy) (Array) actually works

This commit is contained in:
Robert Krimen 2013-04-17 15:08:53 -07:00
parent 0da0545485
commit 9f1daa280e
2 changed files with 7 additions and 2 deletions

View File

@ -24,9 +24,11 @@ func TestArray(t *testing.T) {
test(`
abc = [0, 1, 2, 3];
abc.xyzzy = "Nothing happens.";
delete abc[1];
abc;
`, "0,,2,3")
var xyzzy = delete abc.xyzzy;
[ abc, xyzzy, abc.xyzzy ];
`, "0,,2,3,true,")
}
func TestArray_toString(t *testing.T) {

View File

@ -165,5 +165,8 @@ func (self *_arrayStash) delete(name string) {
if index < int64(len(self.valueArray)) {
self.valueArray[index] = emptyValue()
}
return
}
self._stash.delete(name)
}