Explain that Array.duplicate will not deep-copy Object.

This was somewhat implied by specifically calling out nested arrays and
dictionaries, but I was still unsure and had to test it myself.
One might expect that `Resource` objects, which have a `duplicate`
method, might be deep-copied.
This commit is contained in:
Ryan Roden-Corrent 2022-12-30 11:59:07 -05:00
parent 33afa82fb0
commit 53181e4090
No known key found for this signature in database
GPG key ID: 435D8B10692555C9

View file

@ -243,7 +243,7 @@
<param index="0" name="deep" type="bool" default="false" />
<description>
Returns a copy of the array.
If [param deep] is [code]true[/code], a deep copy is performed: all nested arrays and dictionaries are duplicated and will not be shared with the original array. If [code]false[/code], a shallow copy is made and references to the original nested arrays and dictionaries are kept, so that modifying a sub-array or dictionary in the copy will also impact those referenced in the source array.
If [param deep] is [code]true[/code], a deep copy is performed: all nested arrays and dictionaries are duplicated and will not be shared with the original array. If [code]false[/code], a shallow copy is made and references to the original nested arrays and dictionaries are kept, so that modifying a sub-array or dictionary in the copy will also impact those referenced in the source array. Note that any [Object]-derived elements will be shallow copied regardless of the [param deep] setting.
</description>
</method>
<method name="erase">