From 7a9bff248e3351f051884ef01d7e3b083491000a Mon Sep 17 00:00:00 2001 From: EliteMasterEric Date: Wed, 6 Mar 2024 12:24:25 -0500 Subject: [PATCH] Fix an issue with array.clone() on HTML5 --- source/funkin/import.hx | 2 +- source/funkin/util/tools/DynamicAccessTools.hx | 16 ++++++++++++++++ source/funkin/util/tools/DynamicTools.hx | 14 -------------- 3 files changed, 17 insertions(+), 15 deletions(-) create mode 100644 source/funkin/util/tools/DynamicAccessTools.hx delete mode 100644 source/funkin/util/tools/DynamicTools.hx diff --git a/source/funkin/import.hx b/source/funkin/import.hx index 02055d4ed..66c3470ff 100644 --- a/source/funkin/import.hx +++ b/source/funkin/import.hx @@ -13,7 +13,7 @@ using Lambda; using StringTools; using funkin.util.tools.ArraySortTools; using funkin.util.tools.ArrayTools; -using funkin.util.tools.DynamicTools; +using funkin.util.tools.DynamicAccessTools; using funkin.util.tools.FloatTools; using funkin.util.tools.Int64Tools; using funkin.util.tools.IntTools; diff --git a/source/funkin/util/tools/DynamicAccessTools.hx b/source/funkin/util/tools/DynamicAccessTools.hx new file mode 100644 index 000000000..1c83ce039 --- /dev/null +++ b/source/funkin/util/tools/DynamicAccessTools.hx @@ -0,0 +1,16 @@ +package funkin.util.tools; + +import haxe.DynamicAccess; + +class DynamicAccessTools +{ + /** + * Creates a full clone of the input `DynamicAccess`. + * @param input The `Dynamic` to clone. + * @return A clone of the input `Dynamic`. + */ + public static function clone(input:DynamicAccess):DynamicAccess + { + return Reflect.copy(input); + } +} diff --git a/source/funkin/util/tools/DynamicTools.hx b/source/funkin/util/tools/DynamicTools.hx deleted file mode 100644 index 47501ea22..000000000 --- a/source/funkin/util/tools/DynamicTools.hx +++ /dev/null @@ -1,14 +0,0 @@ -package funkin.util.tools; - -class DynamicTools -{ - /** - * Creates a full clone of the input `Dynamic`. Only guaranteed to work on anonymous structures. - * @param input The `Dynamic` to clone. - * @return A clone of the input `Dynamic`. - */ - public static function clone(input:Dynamic):Dynamic - { - return Reflect.copy(input); - } -}