{"action":"created","issue":{"url":"https://api.github.com/repos/scala-js/scala-js/issues/1876","labels_url":"https://api.github.com/repos/scala-js/scala-js/issues/1876/labels{/name}","comments_url":"https://api.github.com/repos/scala-js/scala-js/issues/1876/comments","events_url":"https://api.github.com/repos/scala-js/scala-js/issues/1876/events","html_url":"https://github.com/scala-js/scala-js/issues/1876","id":103086603,"number":1876,"title":"Default constructor params don't work with @ScalaJSDefined classes","user":{"login":"russpowers","id":1271302,"avatar_url":"https://avatars.githubusercontent.com/u/1271302?v=3","gravatar_id":"","url":"https://api.github.com/users/russpowers","html_url":"https://github.com/russpowers","followers_url":"https://api.github.com/users/russpowers/followers","following_url":"https://api.github.com/users/russpowers/following{/other_user}","gists_url":"https://api.github.com/users/russpowers/gists{/gist_id}","starred_url":"https://api.github.com/users/russpowers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/russpowers/subscriptions","organizations_url":"https://api.github.com/users/russpowers/orgs","repos_url":"https://api.github.com/users/russpowers/repos","events_url":"https://api.github.com/users/russpowers/events{/privacy}","received_events_url":"https://api.github.com/users/russpowers/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-08-25T18:21:36Z","updated_at":"2015-08-25T22:27:32Z","closed_at":null,"body":"This code compiles with no errors:\r\n\r\n```scala\r\n@ScalaJsDefined\r\nclass TestClass(val a: Int = 5) extends js.Object\r\n```\r\n\r\nBut then it throws this runtime error when you try to instantiate `TestClass` without arguments:\r\n\r\n`Uncaught scala.scalajs.runtime.UndefinedBehaviorError: An undefined behavior was detected: undefined is not an instance of java.lang.Integer`"},"comment":{"url":"https://api.github.com/repos/scala-js/scala-js/issues/comments/134760184","html_url":"https://github.com/scala-js/scala-js/issues/1876#issuecomment-134760184","issue_url":"https://api.github.com/repos/scala-js/scala-js/issues/1876","id":134760184,"user":{"login":"russpowers","id":1271302,"avatar_url":"https://avatars.githubusercontent.com/u/1271302?v=3","gravatar_id":"","url":"https://api.github.com/users/russpowers","html_url":"https://github.com/russpowers","followers_url":"https://api.github.com/users/russpowers/followers","following_url":"https://api.github.com/users/russpowers/following{/other_user}","gists_url":"https://api.github.com/users/russpowers/gists{/gist_id}","starred_url":"https://api.github.com/users/russpowers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/russpowers/subscriptions","organizations_url":"https://api.github.com/users/russpowers/orgs","repos_url":"https://api.github.com/users/russpowers/repos","events_url":"https://api.github.com/users/russpowers/events{/privacy}","received_events_url":"https://api.github.com/users/russpowers/received_events","type":"User","site_admin":false},"created_at":"2015-08-25T22:27:32Z","updated_at":"2015-08-25T22:27:32Z","body":"Ok, thanks!"}}