From 2330a4534828e55127440c7500262bec9e38d23d Mon Sep 17 00:00:00 2001 From: Nathan Adams Date: Thu, 3 Aug 2023 12:32:29 +0200 Subject: [PATCH] avm2: Implement XMLList.toJSON() --- core/src/avm2/globals/XMLList.as | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/core/src/avm2/globals/XMLList.as b/core/src/avm2/globals/XMLList.as index a002e40f6..aa7675f69 100644 --- a/core/src/avm2/globals/XMLList.as +++ b/core/src/avm2/globals/XMLList.as @@ -26,6 +26,10 @@ package { // but still exist AS3 native function name(): Object; + AS3 function toJSON(k:String) : * { + return this.toJSON(k); + } + AS3 function valueOf():XMLList { return this; } @@ -99,6 +103,10 @@ package { return self.AS3::text(); } + prototype.toJSON = function(k:String):* { + return "XMLList"; + }; + public static const length:int = 1; } }