Fixed: Make the isa property on classes not enumerable. (#3100)

As we have a tool-free bridges between many classes and JavaScript types by setting the isa property on the type, for example CPArray and Array. Using the for...in enumeration the isa property will be included in the loop if the property is enumerable (this is the default behavior). This commit set the property as not enumerable.

Also added test case for check that the isa property on classes are not enumerable using a for...in loop.
This commit is contained in:
Martin Carlberg
2025-05-14 10:09:01 +02:00
committed by GitHub
parent 2f563fb870
commit 86d595b086
10 changed files with 173 additions and 13 deletions
+12 -1
View File
@@ -360,4 +360,15 @@ var concat = Array.prototype.concat,
@end
Array.prototype.isa = _CPJavaScriptArray;
if (Array.prototype.isa !== _CPJavaScriptArray)
{
Object.defineProperties(Array.prototype,
{
isa:
{
value: _CPJavaScriptArray,
enumerable: false,
writable: true
}
});
}