{"action":"created","issue":{"url":"https://api.github.com/repos/HaxeFoundation/haxe/issues/3934","labels_url":"https://api.github.com/repos/HaxeFoundation/haxe/issues/3934/labels{/name}","comments_url":"https://api.github.com/repos/HaxeFoundation/haxe/issues/3934/comments","events_url":"https://api.github.com/repos/HaxeFoundation/haxe/issues/3934/events","html_url":"https://github.com/HaxeFoundation/haxe/pull/3934","id":59326186,"number":3934,"title":"jsThis","user":{"login":"andyli","id":103977,"avatar_url":"https://avatars.githubusercontent.com/u/103977?v=3","gravatar_id":"","url":"https://api.github.com/users/andyli","html_url":"https://github.com/andyli","followers_url":"https://api.github.com/users/andyli/followers","following_url":"https://api.github.com/users/andyli/following{/other_user}","gists_url":"https://api.github.com/users/andyli/gists{/gist_id}","starred_url":"https://api.github.com/users/andyli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andyli/subscriptions","organizations_url":"https://api.github.com/users/andyli/orgs","repos_url":"https://api.github.com/users/andyli/repos","events_url":"https://api.github.com/users/andyli/events{/privacy}","received_events_url":"https://api.github.com/users/andyli/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-02-28T05:13:17Z","updated_at":"2015-03-01T08:51:20Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/HaxeFoundation/haxe/pulls/3934","html_url":"https://github.com/HaxeFoundation/haxe/pull/3934","diff_url":"https://github.com/HaxeFoundation/haxe/pull/3934.diff","patch_url":"https://github.com/HaxeFoundation/haxe/pull/3934.patch"},"body":"This adds `js.Lib.jsThis` to output plain `this` in JS.\r\nIt is useful when using some JS libs, e.g. jQuery:\r\n\r\n```haxe\r\nimport js.JQuery;\r\nclass Test {\r\n\tstatic function main () {\r\n\t\tnew JQuery(\"div\").each(function(){\r\n\t\t\ttrace(js.Lib.jsThis); //a DivElement\r\n\t\t});\r\n\t}\r\n}\r\n```\r\n\r\n`js.JQuery.cur` provides the js `this` wrapped in jQuery, but someone may only need the contained element.\r\nAlso someone may need to use the js `this` when using other JS libs. "},"comment":{"url":"https://api.github.com/repos/HaxeFoundation/haxe/issues/comments/76588379","html_url":"https://github.com/HaxeFoundation/haxe/pull/3934#issuecomment-76588379","issue_url":"https://api.github.com/repos/HaxeFoundation/haxe/issues/3934","id":76588379,"user":{"login":"ncannasse","id":1022912,"avatar_url":"https://avatars.githubusercontent.com/u/1022912?v=3","gravatar_id":"","url":"https://api.github.com/users/ncannasse","html_url":"https://github.com/ncannasse","followers_url":"https://api.github.com/users/ncannasse/followers","following_url":"https://api.github.com/users/ncannasse/following{/other_user}","gists_url":"https://api.github.com/users/ncannasse/gists{/gist_id}","starred_url":"https://api.github.com/users/ncannasse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ncannasse/subscriptions","organizations_url":"https://api.github.com/users/ncannasse/orgs","repos_url":"https://api.github.com/users/ncannasse/repos","events_url":"https://api.github.com/users/ncannasse/events{/privacy}","received_events_url":"https://api.github.com/users/ncannasse/received_events","type":"User","site_admin":false},"created_at":"2015-03-01T08:51:20Z","updated_at":"2015-03-01T08:51:20Z","body":"@waneck given that this behavior is rarely used in Haxe (the only exception I saw was when writing low level std stuff). I think that the current untyped __this__ works well enough."}}