{"action":"created","issue":{"url":"https://api.github.com/repos/mozilla/rhino/issues/12","labels_url":"https://api.github.com/repos/mozilla/rhino/issues/12/labels{/name}","comments_url":"https://api.github.com/repos/mozilla/rhino/issues/12/comments","events_url":"https://api.github.com/repos/mozilla/rhino/issues/12/events","html_url":"https://github.com/mozilla/rhino/pull/12","id":1883072,"number":12,"title":"Implement support for serializing POJOs to JSON","user":{"login":"pfn","id":512197,"avatar_url":"https://avatars.githubusercontent.com/u/512197?v=3","gravatar_id":"","url":"https://api.github.com/users/pfn","html_url":"https://github.com/pfn","followers_url":"https://api.github.com/users/pfn/followers","following_url":"https://api.github.com/users/pfn/following{/other_user}","gists_url":"https://api.github.com/users/pfn/gists{/gist_id}","starred_url":"https://api.github.com/users/pfn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pfn/subscriptions","organizations_url":"https://api.github.com/users/pfn/orgs","repos_url":"https://api.github.com/users/pfn/repos","events_url":"https://api.github.com/users/pfn/events{/privacy}","received_events_url":"https://api.github.com/users/pfn/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2011-10-12T00:19:09Z","updated_at":"2015-05-04T18:04:36Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/mozilla/rhino/pulls/12","html_url":"https://github.com/mozilla/rhino/pull/12","diff_url":"https://github.com/mozilla/rhino/pull/12.diff","patch_url":"https://github.com/mozilla/rhino/pull/12.patch"},"body":""},"comment":{"url":"https://api.github.com/repos/mozilla/rhino/issues/comments/98798751","html_url":"https://github.com/mozilla/rhino/pull/12#issuecomment-98798751","issue_url":"https://api.github.com/repos/mozilla/rhino/issues/12","id":98798751,"user":{"login":"hrj","id":345879,"avatar_url":"https://avatars.githubusercontent.com/u/345879?v=3","gravatar_id":"","url":"https://api.github.com/users/hrj","html_url":"https://github.com/hrj","followers_url":"https://api.github.com/users/hrj/followers","following_url":"https://api.github.com/users/hrj/following{/other_user}","gists_url":"https://api.github.com/users/hrj/gists{/gist_id}","starred_url":"https://api.github.com/users/hrj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hrj/subscriptions","organizations_url":"https://api.github.com/users/hrj/orgs","repos_url":"https://api.github.com/users/hrj/repos","events_url":"https://api.github.com/users/hrj/events{/privacy}","received_events_url":"https://api.github.com/users/hrj/received_events","type":"User","site_admin":false},"created_at":"2015-05-04T18:04:36Z","updated_at":"2015-05-04T18:04:36Z","body":"@gbrail  Thanks for creating the issue #182 for this.\r\n\r\n@sainaen et al, I am trying to summarize this PR and the issue, based on my understanding, which may be way off. Please correct me if I have it wrong.\r\n\r\nDuring a call to `JSON.stringify` when `toJSON` is not defined for a JS object, the object's properties should be serialized to JSON by default. For a Java object, I guess the properties defined by its Wrapper should be serialized to JSON.\r\n\r\nHowever, this PR gets the properties of a Java object by looking at its bean properties. However, this is very likely not desired. It is the wrapper object that should decide what properties to expose to JS land.\r\n\r\nSo, the `JSON.stringify`method for an object can be simply defined as:\r\n* If the object being stringified has toJSON, then call that. Else,\r\n* Recursively Stringify every property declared by the object.\r\n\r\nIf I am atleast somewhere close to understanding this, I can try to create a new PR."}}