From 53181e4090555b6776b10f93215cde4f990f86f2 Mon Sep 17 00:00:00 2001 From: Ryan Roden-Corrent Date: Fri, 30 Dec 2022 11:59:07 -0500 Subject: [PATCH] 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. --- doc/classes/Array.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/classes/Array.xml b/doc/classes/Array.xml index 603974d6198..3b67eb809c1 100644 --- a/doc/classes/Array.xml +++ b/doc/classes/Array.xml @@ -243,7 +243,7 @@ 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.