playerglobal-source-gen: object methods on prototype
diff --git a/playerglobal-source-gen/src/main/java/org/apache/royale/playerglobal/PlayerglobalSourceGen.java b/playerglobal-source-gen/src/main/java/org/apache/royale/playerglobal/PlayerglobalSourceGen.java
index 5d0ae34..4da3a3d 100644
--- a/playerglobal-source-gen/src/main/java/org/apache/royale/playerglobal/PlayerglobalSourceGen.java
+++ b/playerglobal-source-gen/src/main/java/org/apache/royale/playerglobal/PlayerglobalSourceGen.java
@@ -67,6 +67,9 @@
}
private static final List<String> VECTOR_SUFFIXES = Arrays.asList("$double", "$int", "$uint", "$object");
+ //From the docs: Methods of the Object class are dynamically created on Object's prototype.
+ private static final List<String> OBJECT_PROTOTYPE_METHODS = Arrays.asList("hasOwnProperty", "isPrototypeOf",
+ "propertyIsEnumerable", "setPropertyIsEnumerable", "toString", "toLocaleString", "valueOf");
private static final List<String> XML_ANY_METHODS = Arrays.asList("addNamespace", "appendChild", "attribute",
"child", "contains", "descendants", "elements", "insertChildAfter", "insertChildBefore", "namespace",
"prependChild", "processingInstructions", "removeNamespace", "replace", "setChildren", "setName",
@@ -728,9 +731,10 @@
List<Element> apiParamElements = apiOperationDefElement.elements("apiParam");
- if ("public".equals(access) && ("toString".equals(functionName) || "toLocaleString".equals(functionName))
- || "valueOf".equals(functionName) || "hasOwnProperty".equals(functionName)
- || "propertyIsEnumerable".equals(functionName)) {
+ if ("Object".equals(contextClassName) && OBJECT_PROTOTYPE_METHODS.contains(functionName)) {
+ return;
+ }
+ if ("toString".equals(functionName) && isOverride) {
return;
}