From 0074419f41385c770d29169a13c2782c4341ae45 Mon Sep 17 00:00:00 2001 From: Lord-McSweeney Date: Fri, 13 Dec 2024 14:41:55 -0800 Subject: [PATCH] avm2: Mark XML and XMLList's prototypes as non-enumerable --- core/src/avm2/globals/XML.as | 38 ++++++++++++++++++++++++++++++++ core/src/avm2/globals/XMLList.as | 38 ++++++++++++++++++++++++++++++++ 2 files changed, 76 insertions(+) diff --git a/core/src/avm2/globals/XML.as b/core/src/avm2/globals/XML.as index b935c190b168..4c73cba25db0 100644 --- a/core/src/avm2/globals/XML.as +++ b/core/src/avm2/globals/XML.as @@ -304,6 +304,44 @@ package { self.AS3::setLocalName(name); } + prototype.setPropertyIsEnumerable("hasComplexContent", false); + prototype.setPropertyIsEnumerable("hasSimpleContent", false); + prototype.setPropertyIsEnumerable("name", false); + prototype.setPropertyIsEnumerable("setName", false); + prototype.setPropertyIsEnumerable("namespace", false); + prototype.setPropertyIsEnumerable("addNamespace", false); + prototype.setPropertyIsEnumerable("setNamespace", false); + prototype.setPropertyIsEnumerable("removeNamespace", false); + prototype.setPropertyIsEnumerable("namespaceDeclarations", false); + prototype.setPropertyIsEnumerable("inScopeNamespaces", false); + prototype.setPropertyIsEnumerable("localName", false); + prototype.setPropertyIsEnumerable("toXMLString", false); + prototype.setPropertyIsEnumerable("child", false); + prototype.setPropertyIsEnumerable("childIndex", false); + prototype.setPropertyIsEnumerable("children", false); + prototype.setPropertyIsEnumerable("contains", false); + prototype.setPropertyIsEnumerable("copy", false); + prototype.setPropertyIsEnumerable("parent", false); + prototype.setPropertyIsEnumerable("elements", false); + prototype.setPropertyIsEnumerable("toString", false); + prototype.setPropertyIsEnumerable("attributes", false); + prototype.setPropertyIsEnumerable("attribute", false); + prototype.setPropertyIsEnumerable("nodeKind", false); + prototype.setPropertyIsEnumerable("appendChild", false); + prototype.setPropertyIsEnumerable("prependChild", false); + prototype.setPropertyIsEnumerable("descendants", false); + prototype.setPropertyIsEnumerable("text", false); + prototype.setPropertyIsEnumerable("normalize", false); + prototype.setPropertyIsEnumerable("length", false); + prototype.setPropertyIsEnumerable("toJSON", false); + prototype.setPropertyIsEnumerable("comments", false); + prototype.setPropertyIsEnumerable("processingInstructions", false); + prototype.setPropertyIsEnumerable("insertChildAfter", false); + prototype.setPropertyIsEnumerable("insertChildBefore", false); + prototype.setPropertyIsEnumerable("replace", false); + prototype.setPropertyIsEnumerable("setChildren", false); + prototype.setPropertyIsEnumerable("setLocalName", false); + XML.settings = function() { return XML.AS3::settings(); } diff --git a/core/src/avm2/globals/XMLList.as b/core/src/avm2/globals/XMLList.as index 63d940f36904..ea277b166abf 100644 --- a/core/src/avm2/globals/XMLList.as +++ b/core/src/avm2/globals/XMLList.as @@ -248,6 +248,44 @@ package { return self.AS3::normalize(); } + prototype.setPropertyIsEnumerable("hasComplexContent", false); + prototype.setPropertyIsEnumerable("hasSimpleContent", false); + prototype.setPropertyIsEnumerable("length", false); + prototype.setPropertyIsEnumerable("child", false); + prototype.setPropertyIsEnumerable("children", false); + prototype.setPropertyIsEnumerable("contains", false); + prototype.setPropertyIsEnumerable("copy", false); + prototype.setPropertyIsEnumerable("attribute", false); + prototype.setPropertyIsEnumerable("attributes", false); + prototype.setPropertyIsEnumerable("toString", false); + prototype.setPropertyIsEnumerable("toXMLString", false); + prototype.setPropertyIsEnumerable("addNamespace", false); + prototype.setPropertyIsEnumerable("appendChild", false); + prototype.setPropertyIsEnumerable("childIndex", false); + prototype.setPropertyIsEnumerable("inScopeNamespaces", false); + prototype.setPropertyIsEnumerable("insertChildAfter", false); + prototype.setPropertyIsEnumerable("insertChildBefore", false); + prototype.setPropertyIsEnumerable("localName", false); + prototype.setPropertyIsEnumerable("name", false); + prototype.setPropertyIsEnumerable("namespace", false); + prototype.setPropertyIsEnumerable("namespaceDeclarations", false); + prototype.setPropertyIsEnumerable("nodeKind", false); + prototype.setPropertyIsEnumerable("prependChild", false); + prototype.setPropertyIsEnumerable("removeNamespace", false); + prototype.setPropertyIsEnumerable("replace", false); + prototype.setPropertyIsEnumerable("setChildren", false); + prototype.setPropertyIsEnumerable("setLocalName", false); + prototype.setPropertyIsEnumerable("setName", false); + prototype.setPropertyIsEnumerable("setNamespace", false); + prototype.setPropertyIsEnumerable("descendants", false); + prototype.setPropertyIsEnumerable("text", false); + prototype.setPropertyIsEnumerable("comments", false); + prototype.setPropertyIsEnumerable("parent", false); + prototype.setPropertyIsEnumerable("toJSON", false); + prototype.setPropertyIsEnumerable("processingInstructions", false); + prototype.setPropertyIsEnumerable("elements", false); + prototype.setPropertyIsEnumerable("normalize", false); + public static const length:* = 1; } }