{"action":"created","comment":{"url":"https://api.github.com/repos/Microsoft/TypeScript/pulls/comments/32671316","id":32671316,"diff_hunk":"@@ -6568,6 +6616,394 @@ module ts {\n             }\r\n         }\r\n \r\n+        function checkJsxElement(node: JsxElement) {\r\n+            if ((compilerOptions.jsx || JsxEmit.None) === JsxEmit.None) {\r\n+                error(node, Diagnostics.Cannot_use_JSX_unless_the_jsx_flag_is_provided);\r\n+            }\r\n+\r\n+            checkGrammarJsxElement(node);\r\n+\r\n+            if (!jsxElementType) {\r\n+                error(node, Diagnostics.The_global_type_JSX_Element_must_exist_when_using_JSX);\r\n+                return unknownType;\r\n+            }\r\n+\r\n+            var elemType = checkJsxOpeningElement(node.openingElement);\r\n+\r\n+            for (var i = 0, n = node.children.length; i < n; i++) {\r\n+                if (node.children[i].kind === SyntaxKind.JsxExpression) {\r\n+                    checkJsxExpression(<JsxExpression>node.children[i]);\r\n+                }\r\n+                else if (node.children[i].kind === SyntaxKind.JsxElement) {\r\n+                    checkJsxElement(<JsxElement>node.children[i]);\r\n+                }\r\n+                else {\r\n+                    Debug.assert(node.children[i].kind === SyntaxKind.JsxText);\r\n+                }\r\n+            }\r\n+\r\n+            if (node.closingElement) {\r\n+                checkSourceElement(node.closingElement);\r\n+            }\r\n+\r\n+            return jsxElementType;\r\n+        }\r\n+\r\n+        /// Returns true iff the JSX element name would be a valid identifier, ignoring restrictions about keywords not being identifiers\r\n+        function isIdentifierLike(name: string) {\r\n+            // - is the only character supported in JSX attribute names that isn't valid in JavaScript identifiers\r\n+            return name.indexOf('-') < 0;\r\n+        }\r\n+\r\n+        /// Returns true iff React would emit this tag name as a string rather than an identifier or qualified name\r\n+        function isJsxIntrinsicIdentifier(tagName: Identifier|QualifiedName) {\r\n+            if (tagName.kind === SyntaxKind.QualifiedName) {\r\n+                return false;\r\n+            } else {\r\n+                let firstChar = (<Identifier>tagName).text.charAt(0);\r\n+                return firstChar.toLowerCase() === firstChar;\r\n+            }\r\n+        }\r\n+\r\n+        function checkJsxAttribute(node: JsxAttribute, elementAttributesType: Type, nameTable: Map<boolean>) {\r\n+            var correspondingPropType: Type = unknownType;\r","path":"src/compiler/checker.ts","position":223,"original_position":223,"commit_id":"3dc71af7250a5b80341bdcea4638deff1713dad6","original_commit_id":"f0808820a4b846d7fb8a2162f746727c3a4e3cf1","user":{"login":"RyanCavanaugh","id":6685088,"avatar_url":"https://avatars.githubusercontent.com/u/6685088?v=3","gravatar_id":"","url":"https://api.github.com/users/RyanCavanaugh","html_url":"https://github.com/RyanCavanaugh","followers_url":"https://api.github.com/users/RyanCavanaugh/followers","following_url":"https://api.github.com/users/RyanCavanaugh/following{/other_user}","gists_url":"https://api.github.com/users/RyanCavanaugh/gists{/gist_id}","starred_url":"https://api.github.com/users/RyanCavanaugh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RyanCavanaugh/subscriptions","organizations_url":"https://api.github.com/users/RyanCavanaugh/orgs","repos_url":"https://api.github.com/users/RyanCavanaugh/repos","events_url":"https://api.github.com/users/RyanCavanaugh/events{/privacy}","received_events_url":"https://api.github.com/users/RyanCavanaugh/received_events","type":"User","site_admin":false},"body":":heavy_check_mark: ","created_at":"2015-06-17T20:32:25Z","updated_at":"2015-06-17T20:32:25Z","html_url":"https://github.com/Microsoft/TypeScript/pull/3470#discussion_r32671316","pull_request_url":"https://api.github.com/repos/Microsoft/TypeScript/pulls/3470","_links":{"self":{"href":"https://api.github.com/repos/Microsoft/TypeScript/pulls/comments/32671316"},"html":{"href":"https://github.com/Microsoft/TypeScript/pull/3470#discussion_r32671316"},"pull_request":{"href":"https://api.github.com/repos/Microsoft/TypeScript/pulls/3470"}}},"pull_request":{"url":"https://api.github.com/repos/Microsoft/TypeScript/pulls/3470","id":37383591,"html_url":"https://github.com/Microsoft/TypeScript/pull/3470","diff_url":"https://github.com/Microsoft/TypeScript/pull/3470.diff","patch_url":"https://github.com/Microsoft/TypeScript/pull/3470.patch","issue_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/3470","number":3470,"state":"open","locked":false,"title":"JSX","user":{"login":"RyanCavanaugh","id":6685088,"avatar_url":"https://avatars.githubusercontent.com/u/6685088?v=3","gravatar_id":"","url":"https://api.github.com/users/RyanCavanaugh","html_url":"https://github.com/RyanCavanaugh","followers_url":"https://api.github.com/users/RyanCavanaugh/followers","following_url":"https://api.github.com/users/RyanCavanaugh/following{/other_user}","gists_url":"https://api.github.com/users/RyanCavanaugh/gists{/gist_id}","starred_url":"https://api.github.com/users/RyanCavanaugh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RyanCavanaugh/subscriptions","organizations_url":"https://api.github.com/users/RyanCavanaugh/orgs","repos_url":"https://api.github.com/users/RyanCavanaugh/repos","events_url":"https://api.github.com/users/RyanCavanaugh/events{/privacy}","received_events_url":"https://api.github.com/users/RyanCavanaugh/received_events","type":"User","site_admin":false},"body":"This implements JSX parsing, typechecking, JSX emit, and React emit as specified in #3203.\r\n\r\nOne deviation not written up in that issue yet is that we need to use the Uppercase/lowercase distinction to determine intrinsic vs class elements due to our inability to see the IntrinsicElements type during transpilations.\r\n\r\n@fdecampredon is going to rework the parsing/scanning in a future PR to remove the long-lookahead caused by `<T>x` type assertion syntax. This will also include some work to better handle whitespace between opening and closing tags that will result in significant simplification of the emitter (which currently has to reconstruct leading/trailing whitespace between JSX text and JSX expressions in Child positions).","created_at":"2015-06-10T17:30:17Z","updated_at":"2015-06-17T20:32:25Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4956cb59dbd2574b0be72bf84d0626a41f30f59c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Microsoft/TypeScript/pulls/3470/commits","review_comments_url":"https://api.github.com/repos/Microsoft/TypeScript/pulls/3470/comments","review_comment_url":"https://api.github.com/repos/Microsoft/TypeScript/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/3470/comments","statuses_url":"https://api.github.com/repos/Microsoft/TypeScript/statuses/3dc71af7250a5b80341bdcea4638deff1713dad6","head":{"label":"RyanCavanaugh:jsx","ref":"jsx","sha":"3dc71af7250a5b80341bdcea4638deff1713dad6","user":{"login":"RyanCavanaugh","id":6685088,"avatar_url":"https://avatars.githubusercontent.com/u/6685088?v=3","gravatar_id":"","url":"https://api.github.com/users/RyanCavanaugh","html_url":"https://github.com/RyanCavanaugh","followers_url":"https://api.github.com/users/RyanCavanaugh/followers","following_url":"https://api.github.com/users/RyanCavanaugh/following{/other_user}","gists_url":"https://api.github.com/users/RyanCavanaugh/gists{/gist_id}","starred_url":"https://api.github.com/users/RyanCavanaugh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RyanCavanaugh/subscriptions","organizations_url":"https://api.github.com/users/RyanCavanaugh/orgs","repos_url":"https://api.github.com/users/RyanCavanaugh/repos","events_url":"https://api.github.com/users/RyanCavanaugh/events{/privacy}","received_events_url":"https://api.github.com/users/RyanCavanaugh/received_events","type":"User","site_admin":false},"repo":{"id":34357954,"name":"TypeScript","full_name":"RyanCavanaugh/TypeScript","owner":{"login":"RyanCavanaugh","id":6685088,"avatar_url":"https://avatars.githubusercontent.com/u/6685088?v=3","gravatar_id":"","url":"https://api.github.com/users/RyanCavanaugh","html_url":"https://github.com/RyanCavanaugh","followers_url":"https://api.github.com/users/RyanCavanaugh/followers","following_url":"https://api.github.com/users/RyanCavanaugh/following{/other_user}","gists_url":"https://api.github.com/users/RyanCavanaugh/gists{/gist_id}","starred_url":"https://api.github.com/users/RyanCavanaugh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RyanCavanaugh/subscriptions","organizations_url":"https://api.github.com/users/RyanCavanaugh/orgs","repos_url":"https://api.github.com/users/RyanCavanaugh/repos","events_url":"https://api.github.com/users/RyanCavanaugh/events{/privacy}","received_events_url":"https://api.github.com/users/RyanCavanaugh/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/RyanCavanaugh/TypeScript","description":"TypeScript is a superset of JavaScript that compiles to clean JavaScript output.","fork":true,"url":"https://api.github.com/repos/RyanCavanaugh/TypeScript","forks_url":"https://api.github.com/repos/RyanCavanaugh/TypeScript/forks","keys_url":"https://api.github.com/repos/RyanCavanaugh/TypeScript/keys{/key_id}","collaborators_url":"https://api.github.com/repos/RyanCavanaugh/TypeScript/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/RyanCavanaugh/TypeScript/teams","hooks_url":"https://api.github.com/repos/RyanCavanaugh/TypeScript/hooks","issue_events_url":"https://api.github.com/repos/RyanCavanaugh/TypeScript/issues/events{/number}","events_url":"https://api.github.com/repos/RyanCavanaugh/TypeScript/events","assignees_url":"https://api.github.com/repos/RyanCavanaugh/TypeScript/assignees{/user}","branches_url":"https://api.github.com/repos/RyanCavanaugh/TypeScript/branches{/branch}","tags_url":"https://api.github.com/repos/RyanCavanaugh/TypeScript/tags","blobs_url":"https://api.github.com/repos/RyanCavanaugh/TypeScript/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/RyanCavanaugh/TypeScript/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/RyanCavanaugh/TypeScript/git/refs{/sha}","trees_url":"https://api.github.com/repos/RyanCavanaugh/TypeScript/git/trees{/sha}","statuses_url":"https://api.github.com/repos/RyanCavanaugh/TypeScript/statuses/{sha}","languages_url":"https://api.github.com/repos/RyanCavanaugh/TypeScript/languages","stargazers_url":"https://api.github.com/repos/RyanCavanaugh/TypeScript/stargazers","contributors_url":"https://api.github.com/repos/RyanCavanaugh/TypeScript/contributors","subscribers_url":"https://api.github.com/repos/RyanCavanaugh/TypeScript/subscribers","subscription_url":"https://api.github.com/repos/RyanCavanaugh/TypeScript/subscription","commits_url":"https://api.github.com/repos/RyanCavanaugh/TypeScript/commits{/sha}","git_commits_url":"https://api.github.com/repos/RyanCavanaugh/TypeScript/git/commits{/sha}","comments_url":"https://api.github.com/repos/RyanCavanaugh/TypeScript/comments{/number}","issue_comment_url":"https://api.github.com/repos/RyanCavanaugh/TypeScript/issues/comments{/number}","contents_url":"https://api.github.com/repos/RyanCavanaugh/TypeScript/contents/{+path}","compare_url":"https://api.github.com/repos/RyanCavanaugh/TypeScript/compare/{base}...{head}","merges_url":"https://api.github.com/repos/RyanCavanaugh/TypeScript/merges","archive_url":"https://api.github.com/repos/RyanCavanaugh/TypeScript/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/RyanCavanaugh/TypeScript/downloads","issues_url":"https://api.github.com/repos/RyanCavanaugh/TypeScript/issues{/number}","pulls_url":"https://api.github.com/repos/RyanCavanaugh/TypeScript/pulls{/number}","milestones_url":"https://api.github.com/repos/RyanCavanaugh/TypeScript/milestones{/number}","notifications_url":"https://api.github.com/repos/RyanCavanaugh/TypeScript/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/RyanCavanaugh/TypeScript/labels{/name}","releases_url":"https://api.github.com/repos/RyanCavanaugh/TypeScript/releases{/id}","created_at":"2015-04-21T23:41:09Z","updated_at":"2015-06-02T22:06:17Z","pushed_at":"2015-06-17T18:01:11Z","git_url":"git://github.com/RyanCavanaugh/TypeScript.git","ssh_url":"git@github.com:RyanCavanaugh/TypeScript.git","clone_url":"https://github.com/RyanCavanaugh/TypeScript.git","svn_url":"https://github.com/RyanCavanaugh/TypeScript","homepage":"http://www.typescriptlang.org","size":173553,"stargazers_count":0,"watchers_count":0,"language":"TypeScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"Microsoft:master","ref":"master","sha":"d49fe6ab5370c7fb101ba8c23b06048a8dc6e158","user":{"login":"Microsoft","id":6154722,"avatar_url":"https://avatars.githubusercontent.com/u/6154722?v=3","gravatar_id":"","url":"https://api.github.com/users/Microsoft","html_url":"https://github.com/Microsoft","followers_url":"https://api.github.com/users/Microsoft/followers","following_url":"https://api.github.com/users/Microsoft/following{/other_user}","gists_url":"https://api.github.com/users/Microsoft/gists{/gist_id}","starred_url":"https://api.github.com/users/Microsoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Microsoft/subscriptions","organizations_url":"https://api.github.com/users/Microsoft/orgs","repos_url":"https://api.github.com/users/Microsoft/repos","events_url":"https://api.github.com/users/Microsoft/events{/privacy}","received_events_url":"https://api.github.com/users/Microsoft/received_events","type":"Organization","site_admin":false},"repo":{"id":20929025,"name":"TypeScript","full_name":"Microsoft/TypeScript","owner":{"login":"Microsoft","id":6154722,"avatar_url":"https://avatars.githubusercontent.com/u/6154722?v=3","gravatar_id":"","url":"https://api.github.com/users/Microsoft","html_url":"https://github.com/Microsoft","followers_url":"https://api.github.com/users/Microsoft/followers","following_url":"https://api.github.com/users/Microsoft/following{/other_user}","gists_url":"https://api.github.com/users/Microsoft/gists{/gist_id}","starred_url":"https://api.github.com/users/Microsoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Microsoft/subscriptions","organizations_url":"https://api.github.com/users/Microsoft/orgs","repos_url":"https://api.github.com/users/Microsoft/repos","events_url":"https://api.github.com/users/Microsoft/events{/privacy}","received_events_url":"https://api.github.com/users/Microsoft/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Microsoft/TypeScript","description":"TypeScript is a superset of JavaScript that compiles to clean JavaScript output.","fork":false,"url":"https://api.github.com/repos/Microsoft/TypeScript","forks_url":"https://api.github.com/repos/Microsoft/TypeScript/forks","keys_url":"https://api.github.com/repos/Microsoft/TypeScript/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Microsoft/TypeScript/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Microsoft/TypeScript/teams","hooks_url":"https://api.github.com/repos/Microsoft/TypeScript/hooks","issue_events_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/events{/number}","events_url":"https://api.github.com/repos/Microsoft/TypeScript/events","assignees_url":"https://api.github.com/repos/Microsoft/TypeScript/assignees{/user}","branches_url":"https://api.github.com/repos/Microsoft/TypeScript/branches{/branch}","tags_url":"https://api.github.com/repos/Microsoft/TypeScript/tags","blobs_url":"https://api.github.com/repos/Microsoft/TypeScript/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Microsoft/TypeScript/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Microsoft/TypeScript/git/refs{/sha}","trees_url":"https://api.github.com/repos/Microsoft/TypeScript/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Microsoft/TypeScript/statuses/{sha}","languages_url":"https://api.github.com/repos/Microsoft/TypeScript/languages","stargazers_url":"https://api.github.com/repos/Microsoft/TypeScript/stargazers","contributors_url":"https://api.github.com/repos/Microsoft/TypeScript/contributors","subscribers_url":"https://api.github.com/repos/Microsoft/TypeScript/subscribers","subscription_url":"https://api.github.com/repos/Microsoft/TypeScript/subscription","commits_url":"https://api.github.com/repos/Microsoft/TypeScript/commits{/sha}","git_commits_url":"https://api.github.com/repos/Microsoft/TypeScript/git/commits{/sha}","comments_url":"https://api.github.com/repos/Microsoft/TypeScript/comments{/number}","issue_comment_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/comments{/number}","contents_url":"https://api.github.com/repos/Microsoft/TypeScript/contents/{+path}","compare_url":"https://api.github.com/repos/Microsoft/TypeScript/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Microsoft/TypeScript/merges","archive_url":"https://api.github.com/repos/Microsoft/TypeScript/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Microsoft/TypeScript/downloads","issues_url":"https://api.github.com/repos/Microsoft/TypeScript/issues{/number}","pulls_url":"https://api.github.com/repos/Microsoft/TypeScript/pulls{/number}","milestones_url":"https://api.github.com/repos/Microsoft/TypeScript/milestones{/number}","notifications_url":"https://api.github.com/repos/Microsoft/TypeScript/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Microsoft/TypeScript/labels{/name}","releases_url":"https://api.github.com/repos/Microsoft/TypeScript/releases{/id}","created_at":"2014-06-17T15:28:39Z","updated_at":"2015-06-17T18:46:17Z","pushed_at":"2015-06-17T20:29:20Z","git_url":"git://github.com/Microsoft/TypeScript.git","ssh_url":"git@github.com:Microsoft/TypeScript.git","clone_url":"https://github.com/Microsoft/TypeScript.git","svn_url":"https://github.com/Microsoft/TypeScript","homepage":"http://www.typescriptlang.org","size":867833,"stargazers_count":5597,"watchers_count":5597,"language":"TypeScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":589,"mirror_url":null,"open_issues_count":650,"forks":589,"open_issues":650,"watchers":5597,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Microsoft/TypeScript/pulls/3470"},"html":{"href":"https://github.com/Microsoft/TypeScript/pull/3470"},"issue":{"href":"https://api.github.com/repos/Microsoft/TypeScript/issues/3470"},"comments":{"href":"https://api.github.com/repos/Microsoft/TypeScript/issues/3470/comments"},"review_comments":{"href":"https://api.github.com/repos/Microsoft/TypeScript/pulls/3470/comments"},"review_comment":{"href":"https://api.github.com/repos/Microsoft/TypeScript/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Microsoft/TypeScript/pulls/3470/commits"},"statuses":{"href":"https://api.github.com/repos/Microsoft/TypeScript/statuses/3dc71af7250a5b80341bdcea4638deff1713dad6"}}}}