{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/12488","repository_url":"https://api.github.com/repos/Microsoft/TypeScript","labels_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/12488/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/12488/comments","events_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/12488/events","html_url":"https://github.com/Microsoft/TypeScript/pull/12488","id":191557745,"number":12488,"title":"change class inheritance code","user":{"login":"vvakame","id":125332,"avatar_url":"https://avatars.githubusercontent.com/u/125332?v=3","gravatar_id":"","url":"https://api.github.com/users/vvakame","html_url":"https://github.com/vvakame","followers_url":"https://api.github.com/users/vvakame/followers","following_url":"https://api.github.com/users/vvakame/following{/other_user}","gists_url":"https://api.github.com/users/vvakame/gists{/gist_id}","starred_url":"https://api.github.com/users/vvakame/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vvakame/subscriptions","organizations_url":"https://api.github.com/users/vvakame/orgs","repos_url":"https://api.github.com/users/vvakame/repos","events_url":"https://api.github.com/users/vvakame/events{/privacy}","received_events_url":"https://api.github.com/users/vvakame/received_events","type":"User","site_admin":false},"labels":[{"id":197491767,"url":"https://api.github.com/repos/Microsoft/TypeScript/labels/cla-already-signed","name":"cla-already-signed","color":"009800","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-11-24T16:21:25Z","updated_at":"2016-12-03T00:03:07Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/Microsoft/TypeScript/pulls/12488","html_url":"https://github.com/Microsoft/TypeScript/pull/12488","diff_url":"https://github.com/Microsoft/TypeScript/pull/12488.diff","patch_url":"https://github.com/Microsoft/TypeScript/pull/12488.patch"},"body":"Fixes / #3610 partially\r\n\r\nThis change makes happy with babel generated code.\r\nrelated https://github.com/skatejs/skatejs/issues/936\r\n\r\nIn [ECMAScript 2015](http://www.ecma-international.org/ecma-262/6.0/).\r\nclass member must be `enumerable: false`, but tsc generated es5 code is `enumerable: true`.\r\n\r\n```\r\nclass Test {\r\n  static foo() {}\r\n}\r\nlet d = Object.getOwnPropertyDescriptor(Test, \"foo\");\r\n// {\"writable\":true,\"enumerable\":false,\"configurable\":true}\r\nconsole.log(JSON.stringify(d));\r\n```\r\n\r\nTypeScript's helper function.\r\n\r\n```\r\nvar __extends = (this && this.__extends) || function (d, b) {\r\n    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\r\n    function __() { this.constructor = d; }\r\n    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n};\r\n```\r\n\r\nthis function copies `enumerable: true` property only.\r\nI replace `for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];` to `Object.setPrototypeOf(d, b);`.\r\n\r\nI do not know whether it is complicated and understanding is correct or not...\r\n[14.5.14 Runtime Semantics: ClassDefinitionEvaluation](http://www.ecma-international.org/ecma-262/6.0/#sec-runtime-semantics-classdefinitionevaluation) -> 14.5.14.12. ... DefineMethod... -> [14.3.8 Runtime Semantics: DefineMethod](http://www.ecma-international.org/ecma-262/6.0/#sec-runtime-semantics-definemethod) -> 14.3.8.7. ... MakeMethod ... -> [9.2.10 MakeMethod](http://www.ecma-international.org/ecma-262/6.0/#sec-makemethod) -> 9.2.10.3 ...[[HomeObject]] ... -> [9.2 ECMAScript Function Objects](http://www.ecma-international.org/ecma-262/6.0/#sec-ecmascript-function-objects) `If the function uses super, this is the object whose [[GetPrototypeOf]] provides the object where super property lookups begin.`\r\n"},"comment":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/comments/264595420","html_url":"https://github.com/Microsoft/TypeScript/pull/12488#issuecomment-264595420","issue_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/12488","id":264595420,"user":{"login":"falsandtru","id":3143368,"avatar_url":"https://avatars.githubusercontent.com/u/3143368?v=3","gravatar_id":"","url":"https://api.github.com/users/falsandtru","html_url":"https://github.com/falsandtru","followers_url":"https://api.github.com/users/falsandtru/followers","following_url":"https://api.github.com/users/falsandtru/following{/other_user}","gists_url":"https://api.github.com/users/falsandtru/gists{/gist_id}","starred_url":"https://api.github.com/users/falsandtru/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/falsandtru/subscriptions","organizations_url":"https://api.github.com/users/falsandtru/orgs","repos_url":"https://api.github.com/users/falsandtru/repos","events_url":"https://api.github.com/users/falsandtru/events{/privacy}","received_events_url":"https://api.github.com/users/falsandtru/received_events","type":"User","site_admin":false},"created_at":"2016-12-03T00:03:07Z","updated_at":"2016-12-03T00:03:07Z","body":"Even if this change will be optional, if someone adds and exposes this incompatibility with IE to npm, it will pollute all downstream packages. Then many packages won't work with IE because of this change. I am very worried about it."}}
{"actor":{"display_login":"falsandtru"}}