Fix an issue with array.clone() on HTML5

This commit is contained in:
EliteMasterEric 2024-03-06 12:24:25 -05:00
parent 67788d762d
commit 7a9bff248e
3 changed files with 17 additions and 15 deletions

View file

@ -13,7 +13,7 @@ using Lambda;
using StringTools; using StringTools;
using funkin.util.tools.ArraySortTools; using funkin.util.tools.ArraySortTools;
using funkin.util.tools.ArrayTools; using funkin.util.tools.ArrayTools;
using funkin.util.tools.DynamicTools; using funkin.util.tools.DynamicAccessTools;
using funkin.util.tools.FloatTools; using funkin.util.tools.FloatTools;
using funkin.util.tools.Int64Tools; using funkin.util.tools.Int64Tools;
using funkin.util.tools.IntTools; using funkin.util.tools.IntTools;

View file

@ -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<T>):DynamicAccess<T>
{
return Reflect.copy(input);
}
}

View file

@ -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);
}
}