{"action":"created","comment":{"url":"https://api.github.com/repos/vuejs/vue/pulls/comments/44369167","id":44369167,"diff_hunk":"@@ -172,11 +173,27 @@ function copyAugment (target, src, keys) {\n \n function defineReactive (obj, key, val) {\n   var dep = new Dep()\n-  var childOb = Observer.create(val)\n+\n+  var target = {\n+    val: val\n+  }\n+\n+  if (config.convertAllProperties) {\n+    var property = Object.getOwnPropertyDescriptor(obj, key)\n+    if (property && property.get && property.set) {","path":"src/observer/index.js","position":18,"original_position":18,"commit_id":"9e11b6208218b5eec21d1a449f0c9654c717286c","original_commit_id":"9e11b6208218b5eec21d1a449f0c9654c717286c","user":{"login":"yyx990803","id":499550,"avatar_url":"https://avatars.githubusercontent.com/u/499550?v=3","gravatar_id":"","url":"https://api.github.com/users/yyx990803","html_url":"https://github.com/yyx990803","followers_url":"https://api.github.com/users/yyx990803/followers","following_url":"https://api.github.com/users/yyx990803/following{/other_user}","gists_url":"https://api.github.com/users/yyx990803/gists{/gist_id}","starred_url":"https://api.github.com/users/yyx990803/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yyx990803/subscriptions","organizations_url":"https://api.github.com/users/yyx990803/orgs","repos_url":"https://api.github.com/users/yyx990803/repos","events_url":"https://api.github.com/users/yyx990803/events{/privacy}","received_events_url":"https://api.github.com/users/yyx990803/received_events","type":"User","site_admin":false},"body":"Just noticed it's possible for a property to only have getters, or only have setters. We should handle all three possible situations here. Probably need to procedurally build up the descriptor based on the presence of the getter and the setter.","created_at":"2015-11-10T04:23:49Z","updated_at":"2015-11-10T04:23:49Z","html_url":"https://github.com/vuejs/vue/pull/1762#discussion_r44369167","pull_request_url":"https://api.github.com/repos/vuejs/vue/pulls/1762","_links":{"self":{"href":"https://api.github.com/repos/vuejs/vue/pulls/comments/44369167"},"html":{"href":"https://github.com/vuejs/vue/pull/1762#discussion_r44369167"},"pull_request":{"href":"https://api.github.com/repos/vuejs/vue/pulls/1762"}}},"pull_request":{"url":"https://api.github.com/repos/vuejs/vue/pulls/1762","id":50049596,"html_url":"https://github.com/vuejs/vue/pull/1762","diff_url":"https://github.com/vuejs/vue/pull/1762.diff","patch_url":"https://github.com/vuejs/vue/pull/1762.patch","issue_url":"https://api.github.com/repos/vuejs/vue/issues/1762","number":1762,"state":"open","locked":false,"title":"Added support for properties which were created with defineProperty o…","user":{"login":"jdavidberger","id":8194827,"avatar_url":"https://avatars.githubusercontent.com/u/8194827?v=3","gravatar_id":"","url":"https://api.github.com/users/jdavidberger","html_url":"https://github.com/jdavidberger","followers_url":"https://api.github.com/users/jdavidberger/followers","following_url":"https://api.github.com/users/jdavidberger/following{/other_user}","gists_url":"https://api.github.com/users/jdavidberger/gists{/gist_id}","starred_url":"https://api.github.com/users/jdavidberger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdavidberger/subscriptions","organizations_url":"https://api.github.com/users/jdavidberger/orgs","repos_url":"https://api.github.com/users/jdavidberger/repos","events_url":"https://api.github.com/users/jdavidberger/events{/privacy}","received_events_url":"https://api.github.com/users/jdavidberger/received_events","type":"User","site_admin":false},"body":"…utside of vue.\r\n\r\nPreviously objects with properties with get/set defined outside of vue wouldn't propagate value changes after being made reactive in vue. This uses getOwnPropertyDescriptor to detect that case and account for it. \r\n\r\nSince it seems like every browser with supports defineProperty also supports getOwnPropertyDescriptor, I didn't add any logic to detect/work without it. \r\n\r\nAlso added are two test cases testing the concept. \r\n\r\nIf this addition gets pulled, it'd also probably be worthwhile checking the 'configurable' property. If configurable is set to false, defineReactive currently just throws an error. I imagine the correct behavior would be just to return out without changing anything; but this patch doesn't address it. ","created_at":"2015-11-08T00:43:11Z","updated_at":"2015-11-10T04:23:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a8e6faac1a5073c3fb74ee8e953826304ce33ff0","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/vuejs/vue/pulls/1762/commits","review_comments_url":"https://api.github.com/repos/vuejs/vue/pulls/1762/comments","review_comment_url":"https://api.github.com/repos/vuejs/vue/pulls/comments{/number}","comments_url":"https://api.github.com/repos/vuejs/vue/issues/1762/comments","statuses_url":"https://api.github.com/repos/vuejs/vue/statuses/9e11b6208218b5eec21d1a449f0c9654c717286c","head":{"label":"jdavidberger:dev","ref":"dev","sha":"9e11b6208218b5eec21d1a449f0c9654c717286c","user":{"login":"jdavidberger","id":8194827,"avatar_url":"https://avatars.githubusercontent.com/u/8194827?v=3","gravatar_id":"","url":"https://api.github.com/users/jdavidberger","html_url":"https://github.com/jdavidberger","followers_url":"https://api.github.com/users/jdavidberger/followers","following_url":"https://api.github.com/users/jdavidberger/following{/other_user}","gists_url":"https://api.github.com/users/jdavidberger/gists{/gist_id}","starred_url":"https://api.github.com/users/jdavidberger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdavidberger/subscriptions","organizations_url":"https://api.github.com/users/jdavidberger/orgs","repos_url":"https://api.github.com/users/jdavidberger/repos","events_url":"https://api.github.com/users/jdavidberger/events{/privacy}","received_events_url":"https://api.github.com/users/jdavidberger/received_events","type":"User","site_admin":false},"repo":{"id":45759710,"name":"vue","full_name":"jdavidberger/vue","owner":{"login":"jdavidberger","id":8194827,"avatar_url":"https://avatars.githubusercontent.com/u/8194827?v=3","gravatar_id":"","url":"https://api.github.com/users/jdavidberger","html_url":"https://github.com/jdavidberger","followers_url":"https://api.github.com/users/jdavidberger/followers","following_url":"https://api.github.com/users/jdavidberger/following{/other_user}","gists_url":"https://api.github.com/users/jdavidberger/gists{/gist_id}","starred_url":"https://api.github.com/users/jdavidberger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdavidberger/subscriptions","organizations_url":"https://api.github.com/users/jdavidberger/orgs","repos_url":"https://api.github.com/users/jdavidberger/repos","events_url":"https://api.github.com/users/jdavidberger/events{/privacy}","received_events_url":"https://api.github.com/users/jdavidberger/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jdavidberger/vue","description":"Simple yet powerful library for building modern web interfaces.","fork":true,"url":"https://api.github.com/repos/jdavidberger/vue","forks_url":"https://api.github.com/repos/jdavidberger/vue/forks","keys_url":"https://api.github.com/repos/jdavidberger/vue/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jdavidberger/vue/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jdavidberger/vue/teams","hooks_url":"https://api.github.com/repos/jdavidberger/vue/hooks","issue_events_url":"https://api.github.com/repos/jdavidberger/vue/issues/events{/number}","events_url":"https://api.github.com/repos/jdavidberger/vue/events","assignees_url":"https://api.github.com/repos/jdavidberger/vue/assignees{/user}","branches_url":"https://api.github.com/repos/jdavidberger/vue/branches{/branch}","tags_url":"https://api.github.com/repos/jdavidberger/vue/tags","blobs_url":"https://api.github.com/repos/jdavidberger/vue/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jdavidberger/vue/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jdavidberger/vue/git/refs{/sha}","trees_url":"https://api.github.com/repos/jdavidberger/vue/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jdavidberger/vue/statuses/{sha}","languages_url":"https://api.github.com/repos/jdavidberger/vue/languages","stargazers_url":"https://api.github.com/repos/jdavidberger/vue/stargazers","contributors_url":"https://api.github.com/repos/jdavidberger/vue/contributors","subscribers_url":"https://api.github.com/repos/jdavidberger/vue/subscribers","subscription_url":"https://api.github.com/repos/jdavidberger/vue/subscription","commits_url":"https://api.github.com/repos/jdavidberger/vue/commits{/sha}","git_commits_url":"https://api.github.com/repos/jdavidberger/vue/git/commits{/sha}","comments_url":"https://api.github.com/repos/jdavidberger/vue/comments{/number}","issue_comment_url":"https://api.github.com/repos/jdavidberger/vue/issues/comments{/number}","contents_url":"https://api.github.com/repos/jdavidberger/vue/contents/{+path}","compare_url":"https://api.github.com/repos/jdavidberger/vue/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jdavidberger/vue/merges","archive_url":"https://api.github.com/repos/jdavidberger/vue/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jdavidberger/vue/downloads","issues_url":"https://api.github.com/repos/jdavidberger/vue/issues{/number}","pulls_url":"https://api.github.com/repos/jdavidberger/vue/pulls{/number}","milestones_url":"https://api.github.com/repos/jdavidberger/vue/milestones{/number}","notifications_url":"https://api.github.com/repos/jdavidberger/vue/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jdavidberger/vue/labels{/name}","releases_url":"https://api.github.com/repos/jdavidberger/vue/releases{/id}","created_at":"2015-11-07T23:49:50Z","updated_at":"2015-11-07T23:49:52Z","pushed_at":"2015-11-10T01:09:30Z","git_url":"git://github.com/jdavidberger/vue.git","ssh_url":"git@github.com:jdavidberger/vue.git","clone_url":"https://github.com/jdavidberger/vue.git","svn_url":"https://github.com/jdavidberger/vue","homepage":"http://vuejs.org","size":7068,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","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":"dev"}},"base":{"label":"vuejs:dev","ref":"dev","sha":"6ce6e0c9955667fb5f150823d0c97f3ffbb9d484","user":{"login":"vuejs","id":6128107,"avatar_url":"https://avatars.githubusercontent.com/u/6128107?v=3","gravatar_id":"","url":"https://api.github.com/users/vuejs","html_url":"https://github.com/vuejs","followers_url":"https://api.github.com/users/vuejs/followers","following_url":"https://api.github.com/users/vuejs/following{/other_user}","gists_url":"https://api.github.com/users/vuejs/gists{/gist_id}","starred_url":"https://api.github.com/users/vuejs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vuejs/subscriptions","organizations_url":"https://api.github.com/users/vuejs/orgs","repos_url":"https://api.github.com/users/vuejs/repos","events_url":"https://api.github.com/users/vuejs/events{/privacy}","received_events_url":"https://api.github.com/users/vuejs/received_events","type":"Organization","site_admin":false},"repo":{"id":11730342,"name":"vue","full_name":"vuejs/vue","owner":{"login":"vuejs","id":6128107,"avatar_url":"https://avatars.githubusercontent.com/u/6128107?v=3","gravatar_id":"","url":"https://api.github.com/users/vuejs","html_url":"https://github.com/vuejs","followers_url":"https://api.github.com/users/vuejs/followers","following_url":"https://api.github.com/users/vuejs/following{/other_user}","gists_url":"https://api.github.com/users/vuejs/gists{/gist_id}","starred_url":"https://api.github.com/users/vuejs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vuejs/subscriptions","organizations_url":"https://api.github.com/users/vuejs/orgs","repos_url":"https://api.github.com/users/vuejs/repos","events_url":"https://api.github.com/users/vuejs/events{/privacy}","received_events_url":"https://api.github.com/users/vuejs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/vuejs/vue","description":"Simple yet powerful library for building modern web interfaces.","fork":false,"url":"https://api.github.com/repos/vuejs/vue","forks_url":"https://api.github.com/repos/vuejs/vue/forks","keys_url":"https://api.github.com/repos/vuejs/vue/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vuejs/vue/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vuejs/vue/teams","hooks_url":"https://api.github.com/repos/vuejs/vue/hooks","issue_events_url":"https://api.github.com/repos/vuejs/vue/issues/events{/number}","events_url":"https://api.github.com/repos/vuejs/vue/events","assignees_url":"https://api.github.com/repos/vuejs/vue/assignees{/user}","branches_url":"https://api.github.com/repos/vuejs/vue/branches{/branch}","tags_url":"https://api.github.com/repos/vuejs/vue/tags","blobs_url":"https://api.github.com/repos/vuejs/vue/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vuejs/vue/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vuejs/vue/git/refs{/sha}","trees_url":"https://api.github.com/repos/vuejs/vue/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vuejs/vue/statuses/{sha}","languages_url":"https://api.github.com/repos/vuejs/vue/languages","stargazers_url":"https://api.github.com/repos/vuejs/vue/stargazers","contributors_url":"https://api.github.com/repos/vuejs/vue/contributors","subscribers_url":"https://api.github.com/repos/vuejs/vue/subscribers","subscription_url":"https://api.github.com/repos/vuejs/vue/subscription","commits_url":"https://api.github.com/repos/vuejs/vue/commits{/sha}","git_commits_url":"https://api.github.com/repos/vuejs/vue/git/commits{/sha}","comments_url":"https://api.github.com/repos/vuejs/vue/comments{/number}","issue_comment_url":"https://api.github.com/repos/vuejs/vue/issues/comments{/number}","contents_url":"https://api.github.com/repos/vuejs/vue/contents/{+path}","compare_url":"https://api.github.com/repos/vuejs/vue/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vuejs/vue/merges","archive_url":"https://api.github.com/repos/vuejs/vue/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vuejs/vue/downloads","issues_url":"https://api.github.com/repos/vuejs/vue/issues{/number}","pulls_url":"https://api.github.com/repos/vuejs/vue/pulls{/number}","milestones_url":"https://api.github.com/repos/vuejs/vue/milestones{/number}","notifications_url":"https://api.github.com/repos/vuejs/vue/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vuejs/vue/labels{/name}","releases_url":"https://api.github.com/repos/vuejs/vue/releases{/id}","created_at":"2013-07-29T03:24:51Z","updated_at":"2015-11-10T04:15:13Z","pushed_at":"2015-11-10T01:09:31Z","git_url":"git://github.com/vuejs/vue.git","ssh_url":"git@github.com:vuejs/vue.git","clone_url":"https://github.com/vuejs/vue.git","svn_url":"https://github.com/vuejs/vue","homepage":"http://vuejs.org","size":13034,"stargazers_count":9308,"watchers_count":9308,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":859,"mirror_url":null,"open_issues_count":15,"forks":859,"open_issues":15,"watchers":9308,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/vuejs/vue/pulls/1762"},"html":{"href":"https://github.com/vuejs/vue/pull/1762"},"issue":{"href":"https://api.github.com/repos/vuejs/vue/issues/1762"},"comments":{"href":"https://api.github.com/repos/vuejs/vue/issues/1762/comments"},"review_comments":{"href":"https://api.github.com/repos/vuejs/vue/pulls/1762/comments"},"review_comment":{"href":"https://api.github.com/repos/vuejs/vue/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/vuejs/vue/pulls/1762/commits"},"statuses":{"href":"https://api.github.com/repos/vuejs/vue/statuses/9e11b6208218b5eec21d1a449f0c9654c717286c"}}}}