{"action":"created","issue":{"url":"https://api.github.com/repos/babel/babel/issues/1748","labels_url":"https://api.github.com/repos/babel/babel/issues/1748/labels{/name}","comments_url":"https://api.github.com/repos/babel/babel/issues/1748/comments","events_url":"https://api.github.com/repos/babel/babel/issues/1748/events","html_url":"https://github.com/babel/babel/issues/1748","id":88258130,"number":1748,"title":"constructor super() transformation output can cause differing runtime if constructor is provided","user":{"login":"jayphelps","id":762949,"avatar_url":"https://avatars.githubusercontent.com/u/762949?v=3","gravatar_id":"","url":"https://api.github.com/users/jayphelps","html_url":"https://github.com/jayphelps","followers_url":"https://api.github.com/users/jayphelps/followers","following_url":"https://api.github.com/users/jayphelps/following{/other_user}","gists_url":"https://api.github.com/users/jayphelps/gists{/gist_id}","starred_url":"https://api.github.com/users/jayphelps/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jayphelps/subscriptions","organizations_url":"https://api.github.com/users/jayphelps/orgs","repos_url":"https://api.github.com/users/jayphelps/repos","events_url":"https://api.github.com/users/jayphelps/events{/privacy}","received_events_url":"https://api.github.com/users/jayphelps/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-06-14T22:26:20Z","updated_at":"2015-06-23T03:07:43Z","closed_at":"2015-06-14T22:44:36Z","body":"When a constructor is not provided to a class, the output code differs from that of when one is provided. This seems harmless but actually can have runtime differences because in the later, `_get(Object.getPrototypeOf(MyElement.prototype), \"constructor\", this).call(this);` the `constructor` property could be reassigned but in the former direct call `_HTMLElement.apply(this, arguments);` this is not possible.\r\n\r\nIn the case of extending from `HTMLElement` and similar, I'm attempting to sort of \"mock\" the ability to have a constructor by doing just that inside a decorator; overriding the super `constructor` to be noop so the browser does not throw `Uncaught TypeError: Illegal constructor`.\r\n\r\nRegardless of whether what I'm doing is \"good or bad\", I don't believe it's intended for two possible runtime outcomes. Which is correct?\r\n\r\n### No constructor provided\r\n```js\r\nclass MyElement extends HTMLElement {\r\n  \r\n}\r\n```\r\n```js\r\nvar MyElement = (function (_HTMLElement) {\r\n  function MyElement() {\r\n    _classCallCheck(this, MyElement);\r\n\r\n    if (_HTMLElement != null) {\r\n      _HTMLElement.apply(this, arguments);\r\n    }\r\n  }\r\n\r\n  _inherits(MyElement, _HTMLElement);\r\n\r\n  return MyElement;\r\n})(HTMLElement);\r\n```\r\n### Constructor provided\r\n```js\r\nclass MyElement extends HTMLElement {\r\n  constructor() {\r\n    super();\r\n  } \r\n}\r\n```\r\n```js\r\nvar MyElement = (function (_HTMLElement) {\r\n  function MyElement() {\r\n    _classCallCheck(this, MyElement);\r\n\r\n    _get(Object.getPrototypeOf(MyElement.prototype), \"constructor\", this).call(this);\r\n  }\r\n\r\n  _inherits(MyElement, _HTMLElement);\r\n\r\n  return MyElement;\r\n})(HTMLElement);\r\n```"},"comment":{"url":"https://api.github.com/repos/babel/babel/issues/comments/114338623","html_url":"https://github.com/babel/babel/issues/1748#issuecomment-114338623","issue_url":"https://api.github.com/repos/babel/babel/issues/1748","id":114338623,"user":{"login":"camelmasa","id":189824,"avatar_url":"https://avatars.githubusercontent.com/u/189824?v=3","gravatar_id":"","url":"https://api.github.com/users/camelmasa","html_url":"https://github.com/camelmasa","followers_url":"https://api.github.com/users/camelmasa/followers","following_url":"https://api.github.com/users/camelmasa/following{/other_user}","gists_url":"https://api.github.com/users/camelmasa/gists{/gist_id}","starred_url":"https://api.github.com/users/camelmasa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/camelmasa/subscriptions","organizations_url":"https://api.github.com/users/camelmasa/orgs","repos_url":"https://api.github.com/users/camelmasa/repos","events_url":"https://api.github.com/users/camelmasa/events{/privacy}","received_events_url":"https://api.github.com/users/camelmasa/received_events","type":"User","site_admin":false},"created_at":"2015-06-23T03:07:43Z","updated_at":"2015-06-23T03:07:43Z","body":"Hi. @sebmck \r\n\r\nDid you fix the problem :question:\r\n\r\n```js\r\nclass MyElement extends HTMLElement {\r\n\r\n}\r\n```\r\n \r\nCan we use above :question: "}}