Skip to content

Commit

Permalink
avm2: Mark XML and XMLList's prototypes as non-enumerable
Browse files Browse the repository at this point in the history
  • Loading branch information
Lord-McSweeney authored and Lord-McSweeney committed Dec 14, 2024
1 parent 320f748 commit 05da3a6
Show file tree
Hide file tree
Showing 2 changed files with 76 additions and 0 deletions.
38 changes: 38 additions & 0 deletions core/src/avm2/globals/XML.as
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down
38 changes: 38 additions & 0 deletions core/src/avm2/globals/XMLList.as
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

0 comments on commit 05da3a6

Please sign in to comment.