{"action":"created","comment":{"url":"https://api.github.com/repos/joeferner/node-java/pulls/comments/29299894","id":29299894,"diff_hunk":"@@ -189,9 +194,21 @@ function isWritable(obj, prop) {\n   return (Object.getOwnPropertyDescriptor(obj, prop) || {}).writable !== false;\n }\n \n+var reservedPropertyNames = [ 'name', 'attributes', 'caller' ];\n+\n+function usableName(obj, name) {\n+  // Node 0.10 and 0.12 have different behavior for whether function.name is declared writable or not.\n+  // This test is constructed so that any unwritable property name OR the name 'name' will be altered,\n+  // to give us consistent behavior for the one known problem case of properties named 'name'.\n+  if (!isWritable(obj, name) || _.includes(reservedPropertyNames, name)) {","path":"lib/nodeJavaBridge.js","position":29,"original_position":29,"commit_id":"5dd2f9fb67e22ea55f65dd5ead23b0389560e9c3","original_commit_id":"5dd2f9fb67e22ea55f65dd5ead23b0389560e9c3","user":{"login":"jsdevel","id":2605980,"avatar_url":"https://avatars.githubusercontent.com/u/2605980?v=3","gravatar_id":"","url":"https://api.github.com/users/jsdevel","html_url":"https://github.com/jsdevel","followers_url":"https://api.github.com/users/jsdevel/followers","following_url":"https://api.github.com/users/jsdevel/following{/other_user}","gists_url":"https://api.github.com/users/jsdevel/gists{/gist_id}","starred_url":"https://api.github.com/users/jsdevel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jsdevel/subscriptions","organizations_url":"https://api.github.com/users/jsdevel/orgs","repos_url":"https://api.github.com/users/jsdevel/repos","events_url":"https://api.github.com/users/jsdevel/events{/privacy}","received_events_url":"https://api.github.com/users/jsdevel/received_events","type":"User","site_admin":false},"body":"This feels overly redundant.  Can't we just trust `isWritable`?","created_at":"2015-04-28T23:44:53Z","updated_at":"2015-04-28T23:44:53Z","html_url":"https://github.com/joeferner/node-java/pull/218#discussion_r29299894","pull_request_url":"https://api.github.com/repos/joeferner/node-java/pulls/218","_links":{"self":{"href":"https://api.github.com/repos/joeferner/node-java/pulls/comments/29299894"},"html":{"href":"https://github.com/joeferner/node-java/pull/218#discussion_r29299894"},"pull_request":{"href":"https://api.github.com/repos/joeferner/node-java/pulls/218"}}},"pull_request":{"url":"https://api.github.com/repos/joeferner/node-java/pulls/218","id":34222283,"html_url":"https://github.com/joeferner/node-java/pull/218","diff_url":"https://github.com/joeferner/node-java/pull/218.diff","patch_url":"https://github.com/joeferner/node-java/pull/218.patch","issue_url":"https://api.github.com/repos/joeferner/node-java/issues/218","number":218,"state":"open","locked":false,"title":"Use alternate name for readonly properties","user":{"login":"jimlloyd","id":18069,"avatar_url":"https://avatars.githubusercontent.com/u/18069?v=3","gravatar_id":"","url":"https://api.github.com/users/jimlloyd","html_url":"https://github.com/jimlloyd","followers_url":"https://api.github.com/users/jimlloyd/followers","following_url":"https://api.github.com/users/jimlloyd/following{/other_user}","gists_url":"https://api.github.com/users/jimlloyd/gists{/gist_id}","starred_url":"https://api.github.com/users/jimlloyd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jimlloyd/subscriptions","organizations_url":"https://api.github.com/users/jimlloyd/orgs","repos_url":"https://api.github.com/users/jimlloyd/repos","events_url":"https://api.github.com/users/jimlloyd/events{/privacy}","received_events_url":"https://api.github.com/users/jimlloyd/received_events","type":"User","site_admin":false},"body":"@joeferner @jsdevel @jugglinmike\r\n\r\nThis is a request for comments, please don't merge.\r\n\r\nI believe this PR is now a complete implementation to handle the problem with `name` being an unwritable property of Functions. This adds another option to asyncOptions named `ifReadOnlySuffix`, which defaults to `_`. It handle both static methods and static fields, and has unit tests for all the cases. Unit tests are passing on both 0.10 and 0.12 on both my Mac and on Travis.\r\n\r\nNote that the problem only manifests on node 0.12, but I thought we should have the same behavior on both 0.10 and 0.12, as it will be easier to document, and easier to write the unit tests. So there is a hack such that the property name `name` will always be translated to the alternate name (e.g. `name_`) even on node 0.10 where it wasn't necessary.\r\n\r\nI haven't yet updated the README.md to document this behavior, in case any of you guys disagree with my decisions. I'll add a commit with the updated README once we have consensus.","created_at":"2015-04-27T23:57:53Z","updated_at":"2015-04-28T23:44:53Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1a81da4c20c467e675dc5e32a494b41b69888482","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/joeferner/node-java/pulls/218/commits","review_comments_url":"https://api.github.com/repos/joeferner/node-java/pulls/218/comments","review_comment_url":"https://api.github.com/repos/joeferner/node-java/pulls/comments{/number}","comments_url":"https://api.github.com/repos/joeferner/node-java/issues/218/comments","statuses_url":"https://api.github.com/repos/joeferner/node-java/statuses/5dd2f9fb67e22ea55f65dd5ead23b0389560e9c3","head":{"label":"RedSeal-co:use-alternate-name-for-readonly-properties.r1","ref":"use-alternate-name-for-readonly-properties.r1","sha":"5dd2f9fb67e22ea55f65dd5ead23b0389560e9c3","user":{"login":"RedSeal-co","id":11355140,"avatar_url":"https://avatars.githubusercontent.com/u/11355140?v=3","gravatar_id":"","url":"https://api.github.com/users/RedSeal-co","html_url":"https://github.com/RedSeal-co","followers_url":"https://api.github.com/users/RedSeal-co/followers","following_url":"https://api.github.com/users/RedSeal-co/following{/other_user}","gists_url":"https://api.github.com/users/RedSeal-co/gists{/gist_id}","starred_url":"https://api.github.com/users/RedSeal-co/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RedSeal-co/subscriptions","organizations_url":"https://api.github.com/users/RedSeal-co/orgs","repos_url":"https://api.github.com/users/RedSeal-co/repos","events_url":"https://api.github.com/users/RedSeal-co/events{/privacy}","received_events_url":"https://api.github.com/users/RedSeal-co/received_events","type":"Organization","site_admin":false},"repo":{"id":32033964,"name":"node-java","full_name":"RedSeal-co/node-java","owner":{"login":"RedSeal-co","id":11355140,"avatar_url":"https://avatars.githubusercontent.com/u/11355140?v=3","gravatar_id":"","url":"https://api.github.com/users/RedSeal-co","html_url":"https://github.com/RedSeal-co","followers_url":"https://api.github.com/users/RedSeal-co/followers","following_url":"https://api.github.com/users/RedSeal-co/following{/other_user}","gists_url":"https://api.github.com/users/RedSeal-co/gists{/gist_id}","starred_url":"https://api.github.com/users/RedSeal-co/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RedSeal-co/subscriptions","organizations_url":"https://api.github.com/users/RedSeal-co/orgs","repos_url":"https://api.github.com/users/RedSeal-co/repos","events_url":"https://api.github.com/users/RedSeal-co/events{/privacy}","received_events_url":"https://api.github.com/users/RedSeal-co/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/RedSeal-co/node-java","description":"Bridge API to connect with existing Java APIs.","fork":true,"url":"https://api.github.com/repos/RedSeal-co/node-java","forks_url":"https://api.github.com/repos/RedSeal-co/node-java/forks","keys_url":"https://api.github.com/repos/RedSeal-co/node-java/keys{/key_id}","collaborators_url":"https://api.github.com/repos/RedSeal-co/node-java/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/RedSeal-co/node-java/teams","hooks_url":"https://api.github.com/repos/RedSeal-co/node-java/hooks","issue_events_url":"https://api.github.com/repos/RedSeal-co/node-java/issues/events{/number}","events_url":"https://api.github.com/repos/RedSeal-co/node-java/events","assignees_url":"https://api.github.com/repos/RedSeal-co/node-java/assignees{/user}","branches_url":"https://api.github.com/repos/RedSeal-co/node-java/branches{/branch}","tags_url":"https://api.github.com/repos/RedSeal-co/node-java/tags","blobs_url":"https://api.github.com/repos/RedSeal-co/node-java/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/RedSeal-co/node-java/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/RedSeal-co/node-java/git/refs{/sha}","trees_url":"https://api.github.com/repos/RedSeal-co/node-java/git/trees{/sha}","statuses_url":"https://api.github.com/repos/RedSeal-co/node-java/statuses/{sha}","languages_url":"https://api.github.com/repos/RedSeal-co/node-java/languages","stargazers_url":"https://api.github.com/repos/RedSeal-co/node-java/stargazers","contributors_url":"https://api.github.com/repos/RedSeal-co/node-java/contributors","subscribers_url":"https://api.github.com/repos/RedSeal-co/node-java/subscribers","subscription_url":"https://api.github.com/repos/RedSeal-co/node-java/subscription","commits_url":"https://api.github.com/repos/RedSeal-co/node-java/commits{/sha}","git_commits_url":"https://api.github.com/repos/RedSeal-co/node-java/git/commits{/sha}","comments_url":"https://api.github.com/repos/RedSeal-co/node-java/comments{/number}","issue_comment_url":"https://api.github.com/repos/RedSeal-co/node-java/issues/comments{/number}","contents_url":"https://api.github.com/repos/RedSeal-co/node-java/contents/{+path}","compare_url":"https://api.github.com/repos/RedSeal-co/node-java/compare/{base}...{head}","merges_url":"https://api.github.com/repos/RedSeal-co/node-java/merges","archive_url":"https://api.github.com/repos/RedSeal-co/node-java/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/RedSeal-co/node-java/downloads","issues_url":"https://api.github.com/repos/RedSeal-co/node-java/issues{/number}","pulls_url":"https://api.github.com/repos/RedSeal-co/node-java/pulls{/number}","milestones_url":"https://api.github.com/repos/RedSeal-co/node-java/milestones{/number}","notifications_url":"https://api.github.com/repos/RedSeal-co/node-java/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/RedSeal-co/node-java/labels{/name}","releases_url":"https://api.github.com/repos/RedSeal-co/node-java/releases{/id}","created_at":"2015-03-11T18:25:21Z","updated_at":"2015-04-27T21:44:38Z","pushed_at":"2015-04-28T18:43:12Z","git_url":"git://github.com/RedSeal-co/node-java.git","ssh_url":"git@github.com:RedSeal-co/node-java.git","clone_url":"https://github.com/RedSeal-co/node-java.git","svn_url":"https://github.com/RedSeal-co/node-java","homepage":"","size":9485,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"joeferner:master","ref":"master","sha":"78317c8623daa2b05d175aa83eefbcc8067f1e28","user":{"login":"joeferner","id":808857,"avatar_url":"https://avatars.githubusercontent.com/u/808857?v=3","gravatar_id":"","url":"https://api.github.com/users/joeferner","html_url":"https://github.com/joeferner","followers_url":"https://api.github.com/users/joeferner/followers","following_url":"https://api.github.com/users/joeferner/following{/other_user}","gists_url":"https://api.github.com/users/joeferner/gists{/gist_id}","starred_url":"https://api.github.com/users/joeferner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joeferner/subscriptions","organizations_url":"https://api.github.com/users/joeferner/orgs","repos_url":"https://api.github.com/users/joeferner/repos","events_url":"https://api.github.com/users/joeferner/events{/privacy}","received_events_url":"https://api.github.com/users/joeferner/received_events","type":"User","site_admin":false},"repo":{"id":3228734,"name":"node-java","full_name":"joeferner/node-java","owner":{"login":"joeferner","id":808857,"avatar_url":"https://avatars.githubusercontent.com/u/808857?v=3","gravatar_id":"","url":"https://api.github.com/users/joeferner","html_url":"https://github.com/joeferner","followers_url":"https://api.github.com/users/joeferner/followers","following_url":"https://api.github.com/users/joeferner/following{/other_user}","gists_url":"https://api.github.com/users/joeferner/gists{/gist_id}","starred_url":"https://api.github.com/users/joeferner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joeferner/subscriptions","organizations_url":"https://api.github.com/users/joeferner/orgs","repos_url":"https://api.github.com/users/joeferner/repos","events_url":"https://api.github.com/users/joeferner/events{/privacy}","received_events_url":"https://api.github.com/users/joeferner/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/joeferner/node-java","description":"Bridge API to connect with existing Java APIs.","fork":false,"url":"https://api.github.com/repos/joeferner/node-java","forks_url":"https://api.github.com/repos/joeferner/node-java/forks","keys_url":"https://api.github.com/repos/joeferner/node-java/keys{/key_id}","collaborators_url":"https://api.github.com/repos/joeferner/node-java/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/joeferner/node-java/teams","hooks_url":"https://api.github.com/repos/joeferner/node-java/hooks","issue_events_url":"https://api.github.com/repos/joeferner/node-java/issues/events{/number}","events_url":"https://api.github.com/repos/joeferner/node-java/events","assignees_url":"https://api.github.com/repos/joeferner/node-java/assignees{/user}","branches_url":"https://api.github.com/repos/joeferner/node-java/branches{/branch}","tags_url":"https://api.github.com/repos/joeferner/node-java/tags","blobs_url":"https://api.github.com/repos/joeferner/node-java/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/joeferner/node-java/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/joeferner/node-java/git/refs{/sha}","trees_url":"https://api.github.com/repos/joeferner/node-java/git/trees{/sha}","statuses_url":"https://api.github.com/repos/joeferner/node-java/statuses/{sha}","languages_url":"https://api.github.com/repos/joeferner/node-java/languages","stargazers_url":"https://api.github.com/repos/joeferner/node-java/stargazers","contributors_url":"https://api.github.com/repos/joeferner/node-java/contributors","subscribers_url":"https://api.github.com/repos/joeferner/node-java/subscribers","subscription_url":"https://api.github.com/repos/joeferner/node-java/subscription","commits_url":"https://api.github.com/repos/joeferner/node-java/commits{/sha}","git_commits_url":"https://api.github.com/repos/joeferner/node-java/git/commits{/sha}","comments_url":"https://api.github.com/repos/joeferner/node-java/comments{/number}","issue_comment_url":"https://api.github.com/repos/joeferner/node-java/issues/comments{/number}","contents_url":"https://api.github.com/repos/joeferner/node-java/contents/{+path}","compare_url":"https://api.github.com/repos/joeferner/node-java/compare/{base}...{head}","merges_url":"https://api.github.com/repos/joeferner/node-java/merges","archive_url":"https://api.github.com/repos/joeferner/node-java/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/joeferner/node-java/downloads","issues_url":"https://api.github.com/repos/joeferner/node-java/issues{/number}","pulls_url":"https://api.github.com/repos/joeferner/node-java/pulls{/number}","milestones_url":"https://api.github.com/repos/joeferner/node-java/milestones{/number}","notifications_url":"https://api.github.com/repos/joeferner/node-java/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/joeferner/node-java/labels{/name}","releases_url":"https://api.github.com/repos/joeferner/node-java/releases{/id}","created_at":"2012-01-20T18:55:49Z","updated_at":"2015-04-27T19:16:46Z","pushed_at":"2015-04-28T18:43:13Z","git_url":"git://github.com/joeferner/node-java.git","ssh_url":"git@github.com:joeferner/node-java.git","clone_url":"https://github.com/joeferner/node-java.git","svn_url":"https://github.com/joeferner/node-java","homepage":"","size":9668,"stargazers_count":555,"watchers_count":555,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":82,"mirror_url":null,"open_issues_count":24,"forks":82,"open_issues":24,"watchers":555,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/joeferner/node-java/pulls/218"},"html":{"href":"https://github.com/joeferner/node-java/pull/218"},"issue":{"href":"https://api.github.com/repos/joeferner/node-java/issues/218"},"comments":{"href":"https://api.github.com/repos/joeferner/node-java/issues/218/comments"},"review_comments":{"href":"https://api.github.com/repos/joeferner/node-java/pulls/218/comments"},"review_comment":{"href":"https://api.github.com/repos/joeferner/node-java/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/joeferner/node-java/pulls/218/commits"},"statuses":{"href":"https://api.github.com/repos/joeferner/node-java/statuses/5dd2f9fb67e22ea55f65dd5ead23b0389560e9c3"}}}}