You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by ah...@apache.org on 2019/01/11 06:45:04 UTC

[royale-compiler] 05/10: block Object.toJSON. Doesn't seem to be in the ES5 spec. Fixes apache/royale-asjs#367.

This is an automated email from the ASF dual-hosted git repository.

aharui pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-compiler.git

commit 7b2177433bd9bb111694838b8f9dbb9303610089
Author: Alex Harui <ah...@apache.org>
AuthorDate: Wed Jan 9 17:17:18 2019 -0800

    block Object.toJSON.  Doesn't seem to be in the ES5 spec.  Fixes apache/royale-asjs#367.
---
 .../compiler/internal/codegen/typedefs/reference/ClassReference.java | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/compiler-externc/src/main/java/org/apache/royale/compiler/internal/codegen/typedefs/reference/ClassReference.java b/compiler-externc/src/main/java/org/apache/royale/compiler/internal/codegen/typedefs/reference/ClassReference.java
index b766fc1..d32cde3 100644
--- a/compiler-externc/src/main/java/org/apache/royale/compiler/internal/codegen/typedefs/reference/ClassReference.java
+++ b/compiler-externc/src/main/java/org/apache/royale/compiler/internal/codegen/typedefs/reference/ClassReference.java
@@ -644,6 +644,11 @@ public class ClassReference extends BaseReference
         {
             // skipping Object.prototype.toString() allows toString(opt_radix) for Number, int and uint
         }
+        else if (getQualifiedName().equals("Object") && functionName.equals("toJSON"))
+        {
+            // skipping Object.prototype.toJSON().  Doesn't seem to be in the spec and excluding
+        	// in the config seems to also block Date.toJSON
+        }
         else
         {
             instanceMethods.put(functionName, method);