{"action":"created","comment":{"url":"https://api.github.com/repos/tildeio/htmlbars/pulls/comments/22431722","id":22431722,"diff_hunk":"@@ -6,17 +6,20 @@ function updateProperty(value) {\n   this.domHelper.setPropertyStrict(this.element, this.attrName, value);\n }\n \n-function updateAttribute(value) {\n+function updateAttribute(value, namespace) {","path":"packages/morph/lib/attr-morph.js","position":5,"original_position":5,"commit_id":"e59c424ec2a2b2535418e932b68278aa4cdd1bc6","original_commit_id":"e59c424ec2a2b2535418e932b68278aa4cdd1bc6","user":{"login":"mixonic","id":8752,"avatar_url":"https://avatars.githubusercontent.com/u/8752?v=3","gravatar_id":"","url":"https://api.github.com/users/mixonic","html_url":"https://github.com/mixonic","followers_url":"https://api.github.com/users/mixonic/followers","following_url":"https://api.github.com/users/mixonic/following{/other_user}","gists_url":"https://api.github.com/users/mixonic/gists{/gist_id}","starred_url":"https://api.github.com/users/mixonic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mixonic/subscriptions","organizations_url":"https://api.github.com/users/mixonic/orgs","repos_url":"https://api.github.com/users/mixonic/repos","events_url":"https://api.github.com/users/mixonic/events{/privacy}","received_events_url":"https://api.github.com/users/mixonic/received_events","type":"User","site_admin":false},"body":"Please create a separate function for updating a value with a namespace, and assign it to `this._update`. This avoids the branching in logic at update time and ensures that all `_update` functions share an argument signature.\r\n\r\n```js\r\nfunction updateAttributeNS(value) {\r\n  if (value === null) {\r\n    this.domHelper.removeAttribute(this.element, this.attrName);\r\n  } else {\r\n    this.domHelper.setAttributeNS(this.element, this.namespace, this.attrName, value);\r\n  }\r\n}\r\n\r\nfunction AttrMorph(element, attrName, domHelper, namespace) {\r\n  // ....\r\n  this.namespace = namespace || null;\r\n  // ...\r\n\r\n  if (element.namespaceURI === svgNamespace || attrName === 'style' || !normalizedAttrName) {\r\n    this.attrName = attrName;\r\n    this._update = updateAttribute;\r\n  } else {\r\n    this.attrName = normalizedAttrName;\r\n    if (this.namespace === null) {\r\n      this._update = updateProperty;\r\n    } else {\r\n      this._update = updateAttributeNS;\r\n    }\r\n  }\r\n}\r\n```","created_at":"2015-01-03T14:19:51Z","updated_at":"2015-01-03T14:19:51Z","html_url":"https://github.com/tildeio/htmlbars/pull/235#discussion_r22431722","pull_request_url":"https://api.github.com/repos/tildeio/htmlbars/pulls/235","_links":{"self":{"href":"https://api.github.com/repos/tildeio/htmlbars/pulls/comments/22431722"},"html":{"href":"https://github.com/tildeio/htmlbars/pull/235#discussion_r22431722"},"pull_request":{"href":"https://api.github.com/repos/tildeio/htmlbars/pulls/235"}}},"pull_request":{"url":"https://api.github.com/repos/tildeio/htmlbars/pulls/235","id":26746528,"html_url":"https://github.com/tildeio/htmlbars/pull/235","diff_url":"https://github.com/tildeio/htmlbars/pull/235.diff","patch_url":"https://github.com/tildeio/htmlbars/pull/235.patch","issue_url":"https://api.github.com/repos/tildeio/htmlbars/issues/235","number":235,"state":"open","locked":false,"title":"Implement #224 ","user":{"login":"salzhrani","id":302896,"avatar_url":"https://avatars.githubusercontent.com/u/302896?v=3","gravatar_id":"","url":"https://api.github.com/users/salzhrani","html_url":"https://github.com/salzhrani","followers_url":"https://api.github.com/users/salzhrani/followers","following_url":"https://api.github.com/users/salzhrani/following{/other_user}","gists_url":"https://api.github.com/users/salzhrani/gists{/gist_id}","starred_url":"https://api.github.com/users/salzhrani/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/salzhrani/subscriptions","organizations_url":"https://api.github.com/users/salzhrani/orgs","repos_url":"https://api.github.com/users/salzhrani/repos","events_url":"https://api.github.com/users/salzhrani/events{/privacy}","received_events_url":"https://api.github.com/users/salzhrani/received_events","type":"User","site_admin":false},"body":":)","created_at":"2015-01-01T21:11:34Z","updated_at":"2015-01-03T14:19:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6fc67f24658dbcba8219c581a79c12aa77e10680","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/tildeio/htmlbars/pulls/235/commits","review_comments_url":"https://api.github.com/repos/tildeio/htmlbars/pulls/235/comments","review_comment_url":"https://api.github.com/repos/tildeio/htmlbars/pulls/comments/{number}","comments_url":"https://api.github.com/repos/tildeio/htmlbars/issues/235/comments","statuses_url":"https://api.github.com/repos/tildeio/htmlbars/statuses/e59c424ec2a2b2535418e932b68278aa4cdd1bc6","head":{"label":"salzhrani:namespace-attrs","ref":"namespace-attrs","sha":"e59c424ec2a2b2535418e932b68278aa4cdd1bc6","user":{"login":"salzhrani","id":302896,"avatar_url":"https://avatars.githubusercontent.com/u/302896?v=3","gravatar_id":"","url":"https://api.github.com/users/salzhrani","html_url":"https://github.com/salzhrani","followers_url":"https://api.github.com/users/salzhrani/followers","following_url":"https://api.github.com/users/salzhrani/following{/other_user}","gists_url":"https://api.github.com/users/salzhrani/gists{/gist_id}","starred_url":"https://api.github.com/users/salzhrani/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/salzhrani/subscriptions","organizations_url":"https://api.github.com/users/salzhrani/orgs","repos_url":"https://api.github.com/users/salzhrani/repos","events_url":"https://api.github.com/users/salzhrani/events{/privacy}","received_events_url":"https://api.github.com/users/salzhrani/received_events","type":"User","site_admin":false},"repo":{"id":28690455,"name":"htmlbars","full_name":"salzhrani/htmlbars","owner":{"login":"salzhrani","id":302896,"avatar_url":"https://avatars.githubusercontent.com/u/302896?v=3","gravatar_id":"","url":"https://api.github.com/users/salzhrani","html_url":"https://github.com/salzhrani","followers_url":"https://api.github.com/users/salzhrani/followers","following_url":"https://api.github.com/users/salzhrani/following{/other_user}","gists_url":"https://api.github.com/users/salzhrani/gists{/gist_id}","starred_url":"https://api.github.com/users/salzhrani/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/salzhrani/subscriptions","organizations_url":"https://api.github.com/users/salzhrani/orgs","repos_url":"https://api.github.com/users/salzhrani/repos","events_url":"https://api.github.com/users/salzhrani/events{/privacy}","received_events_url":"https://api.github.com/users/salzhrani/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/salzhrani/htmlbars","description":"A variant of Handlebars that emits DOM and allows you to write helpers that manipulate live DOM nodes (very much still a WIP, and focused on the data binding use-case)","fork":true,"url":"https://api.github.com/repos/salzhrani/htmlbars","forks_url":"https://api.github.com/repos/salzhrani/htmlbars/forks","keys_url":"https://api.github.com/repos/salzhrani/htmlbars/keys{/key_id}","collaborators_url":"https://api.github.com/repos/salzhrani/htmlbars/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/salzhrani/htmlbars/teams","hooks_url":"https://api.github.com/repos/salzhrani/htmlbars/hooks","issue_events_url":"https://api.github.com/repos/salzhrani/htmlbars/issues/events{/number}","events_url":"https://api.github.com/repos/salzhrani/htmlbars/events","assignees_url":"https://api.github.com/repos/salzhrani/htmlbars/assignees{/user}","branches_url":"https://api.github.com/repos/salzhrani/htmlbars/branches{/branch}","tags_url":"https://api.github.com/repos/salzhrani/htmlbars/tags","blobs_url":"https://api.github.com/repos/salzhrani/htmlbars/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/salzhrani/htmlbars/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/salzhrani/htmlbars/git/refs{/sha}","trees_url":"https://api.github.com/repos/salzhrani/htmlbars/git/trees{/sha}","statuses_url":"https://api.github.com/repos/salzhrani/htmlbars/statuses/{sha}","languages_url":"https://api.github.com/repos/salzhrani/htmlbars/languages","stargazers_url":"https://api.github.com/repos/salzhrani/htmlbars/stargazers","contributors_url":"https://api.github.com/repos/salzhrani/htmlbars/contributors","subscribers_url":"https://api.github.com/repos/salzhrani/htmlbars/subscribers","subscription_url":"https://api.github.com/repos/salzhrani/htmlbars/subscription","commits_url":"https://api.github.com/repos/salzhrani/htmlbars/commits{/sha}","git_commits_url":"https://api.github.com/repos/salzhrani/htmlbars/git/commits{/sha}","comments_url":"https://api.github.com/repos/salzhrani/htmlbars/comments{/number}","issue_comment_url":"https://api.github.com/repos/salzhrani/htmlbars/issues/comments/{number}","contents_url":"https://api.github.com/repos/salzhrani/htmlbars/contents/{+path}","compare_url":"https://api.github.com/repos/salzhrani/htmlbars/compare/{base}...{head}","merges_url":"https://api.github.com/repos/salzhrani/htmlbars/merges","archive_url":"https://api.github.com/repos/salzhrani/htmlbars/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/salzhrani/htmlbars/downloads","issues_url":"https://api.github.com/repos/salzhrani/htmlbars/issues{/number}","pulls_url":"https://api.github.com/repos/salzhrani/htmlbars/pulls{/number}","milestones_url":"https://api.github.com/repos/salzhrani/htmlbars/milestones{/number}","notifications_url":"https://api.github.com/repos/salzhrani/htmlbars/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/salzhrani/htmlbars/labels{/name}","releases_url":"https://api.github.com/repos/salzhrani/htmlbars/releases{/id}","created_at":"2015-01-01T16:38:54Z","updated_at":"2015-01-01T16:38:55Z","pushed_at":"2015-01-03T13:58:06Z","git_url":"git://github.com/salzhrani/htmlbars.git","ssh_url":"git@github.com:salzhrani/htmlbars.git","clone_url":"https://github.com/salzhrani/htmlbars.git","svn_url":"https://github.com/salzhrani/htmlbars","homepage":null,"size":3168,"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":"master"}},"base":{"label":"tildeio:master","ref":"master","sha":"64baf3de5b9e674069c771fbee682d61ba82a6e3","user":{"login":"tildeio","id":1355851,"avatar_url":"https://avatars.githubusercontent.com/u/1355851?v=3","gravatar_id":"","url":"https://api.github.com/users/tildeio","html_url":"https://github.com/tildeio","followers_url":"https://api.github.com/users/tildeio/followers","following_url":"https://api.github.com/users/tildeio/following{/other_user}","gists_url":"https://api.github.com/users/tildeio/gists{/gist_id}","starred_url":"https://api.github.com/users/tildeio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tildeio/subscriptions","organizations_url":"https://api.github.com/users/tildeio/orgs","repos_url":"https://api.github.com/users/tildeio/repos","events_url":"https://api.github.com/users/tildeio/events{/privacy}","received_events_url":"https://api.github.com/users/tildeio/received_events","type":"Organization","site_admin":false},"repo":{"id":8921879,"name":"htmlbars","full_name":"tildeio/htmlbars","owner":{"login":"tildeio","id":1355851,"avatar_url":"https://avatars.githubusercontent.com/u/1355851?v=3","gravatar_id":"","url":"https://api.github.com/users/tildeio","html_url":"https://github.com/tildeio","followers_url":"https://api.github.com/users/tildeio/followers","following_url":"https://api.github.com/users/tildeio/following{/other_user}","gists_url":"https://api.github.com/users/tildeio/gists{/gist_id}","starred_url":"https://api.github.com/users/tildeio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tildeio/subscriptions","organizations_url":"https://api.github.com/users/tildeio/orgs","repos_url":"https://api.github.com/users/tildeio/repos","events_url":"https://api.github.com/users/tildeio/events{/privacy}","received_events_url":"https://api.github.com/users/tildeio/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/tildeio/htmlbars","description":"A variant of Handlebars that emits DOM and allows you to write helpers that manipulate live DOM nodes (very much still a WIP, and focused on the data binding use-case)","fork":false,"url":"https://api.github.com/repos/tildeio/htmlbars","forks_url":"https://api.github.com/repos/tildeio/htmlbars/forks","keys_url":"https://api.github.com/repos/tildeio/htmlbars/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tildeio/htmlbars/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tildeio/htmlbars/teams","hooks_url":"https://api.github.com/repos/tildeio/htmlbars/hooks","issue_events_url":"https://api.github.com/repos/tildeio/htmlbars/issues/events{/number}","events_url":"https://api.github.com/repos/tildeio/htmlbars/events","assignees_url":"https://api.github.com/repos/tildeio/htmlbars/assignees{/user}","branches_url":"https://api.github.com/repos/tildeio/htmlbars/branches{/branch}","tags_url":"https://api.github.com/repos/tildeio/htmlbars/tags","blobs_url":"https://api.github.com/repos/tildeio/htmlbars/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tildeio/htmlbars/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tildeio/htmlbars/git/refs{/sha}","trees_url":"https://api.github.com/repos/tildeio/htmlbars/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tildeio/htmlbars/statuses/{sha}","languages_url":"https://api.github.com/repos/tildeio/htmlbars/languages","stargazers_url":"https://api.github.com/repos/tildeio/htmlbars/stargazers","contributors_url":"https://api.github.com/repos/tildeio/htmlbars/contributors","subscribers_url":"https://api.github.com/repos/tildeio/htmlbars/subscribers","subscription_url":"https://api.github.com/repos/tildeio/htmlbars/subscription","commits_url":"https://api.github.com/repos/tildeio/htmlbars/commits{/sha}","git_commits_url":"https://api.github.com/repos/tildeio/htmlbars/git/commits{/sha}","comments_url":"https://api.github.com/repos/tildeio/htmlbars/comments{/number}","issue_comment_url":"https://api.github.com/repos/tildeio/htmlbars/issues/comments/{number}","contents_url":"https://api.github.com/repos/tildeio/htmlbars/contents/{+path}","compare_url":"https://api.github.com/repos/tildeio/htmlbars/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tildeio/htmlbars/merges","archive_url":"https://api.github.com/repos/tildeio/htmlbars/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tildeio/htmlbars/downloads","issues_url":"https://api.github.com/repos/tildeio/htmlbars/issues{/number}","pulls_url":"https://api.github.com/repos/tildeio/htmlbars/pulls{/number}","milestones_url":"https://api.github.com/repos/tildeio/htmlbars/milestones{/number}","notifications_url":"https://api.github.com/repos/tildeio/htmlbars/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tildeio/htmlbars/labels{/name}","releases_url":"https://api.github.com/repos/tildeio/htmlbars/releases{/id}","created_at":"2013-03-21T05:32:02Z","updated_at":"2015-01-03T11:28:40Z","pushed_at":"2015-01-02T23:48:52Z","git_url":"git://github.com/tildeio/htmlbars.git","ssh_url":"git@github.com:tildeio/htmlbars.git","clone_url":"https://github.com/tildeio/htmlbars.git","svn_url":"https://github.com/tildeio/htmlbars","homepage":null,"size":3168,"stargazers_count":1101,"watchers_count":1101,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":87,"mirror_url":null,"open_issues_count":15,"forks":87,"open_issues":15,"watchers":1101,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/tildeio/htmlbars/pulls/235"},"html":{"href":"https://github.com/tildeio/htmlbars/pull/235"},"issue":{"href":"https://api.github.com/repos/tildeio/htmlbars/issues/235"},"comments":{"href":"https://api.github.com/repos/tildeio/htmlbars/issues/235/comments"},"review_comments":{"href":"https://api.github.com/repos/tildeio/htmlbars/pulls/235/comments"},"review_comment":{"href":"https://api.github.com/repos/tildeio/htmlbars/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/tildeio/htmlbars/pulls/235/commits"},"statuses":{"href":"https://api.github.com/repos/tildeio/htmlbars/statuses/e59c424ec2a2b2535418e932b68278aa4cdd1bc6"}}}}