{"action":"created","issue":{"url":"https://api.github.com/repos/opal/opal/issues/1176","labels_url":"https://api.github.com/repos/opal/opal/issues/1176/labels{/name}","comments_url":"https://api.github.com/repos/opal/opal/issues/1176/comments","events_url":"https://api.github.com/repos/opal/opal/issues/1176/events","html_url":"https://github.com/opal/opal/issues/1176","id":114470232,"number":1176,"title":"Can't yield a block in initialize","user":{"login":"fazibear","id":687,"avatar_url":"https://avatars.githubusercontent.com/u/687?v=3","gravatar_id":"","url":"https://api.github.com/users/fazibear","html_url":"https://github.com/fazibear","followers_url":"https://api.github.com/users/fazibear/followers","following_url":"https://api.github.com/users/fazibear/following{/other_user}","gists_url":"https://api.github.com/users/fazibear/gists{/gist_id}","starred_url":"https://api.github.com/users/fazibear/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fazibear/subscriptions","organizations_url":"https://api.github.com/users/fazibear/orgs","repos_url":"https://api.github.com/users/fazibear/repos","events_url":"https://api.github.com/users/fazibear/events{/privacy}","received_events_url":"https://api.github.com/users/fazibear/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-11-01T13:40:35Z","updated_at":"2015-11-05T11:23:09Z","closed_at":null,"body":"I think this a bug, pass a block to initialize but can't yield. `block_given?` is also `false`\r\n\r\n```ruby\r\nclass A\r\n  def initialize(opts)\r\n    yield \"OK\"\r\n  end\r\nend\r\n\r\nx = Native(`{a: {b: \"asd\"}}`)\r\n\r\nA.new(x.a.b) do |s|\r\n  puts s\r\nend\r\n```\r\n\r\nThrows exception `Uncaught LocalJumpError: no block given`\r\n\r\nAnd little work around:\r\n\r\n```ruby\r\nclass A\r\n  def initialize(opts)\r\n    yield \"OK\"\r\n  end\r\nend\r\n\r\nx = Native(`{a: {b: \"asd\"}}`)\r\n\r\nc = x.a.b\r\n\r\nA.new(c) do |s|\r\n  puts s\r\nend\r\n```"},"comment":{"url":"https://api.github.com/repos/opal/opal/issues/comments/154035046","html_url":"https://github.com/opal/opal/issues/1176#issuecomment-154035046","issue_url":"https://api.github.com/repos/opal/opal/issues/1176","id":154035046,"user":{"login":"vais","id":77592,"avatar_url":"https://avatars.githubusercontent.com/u/77592?v=3","gravatar_id":"","url":"https://api.github.com/users/vais","html_url":"https://github.com/vais","followers_url":"https://api.github.com/users/vais/followers","following_url":"https://api.github.com/users/vais/following{/other_user}","gists_url":"https://api.github.com/users/vais/gists{/gist_id}","starred_url":"https://api.github.com/users/vais/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vais/subscriptions","organizations_url":"https://api.github.com/users/vais/orgs","repos_url":"https://api.github.com/users/vais/repos","events_url":"https://api.github.com/users/vais/events{/privacy}","received_events_url":"https://api.github.com/users/vais/received_events","type":"User","site_admin":false},"created_at":"2015-11-05T11:23:09Z","updated_at":"2015-11-05T11:23:09Z","body":"@elia but the `$$p` is a property on an object that is not shared with the other code, so how...? I don't even... :confused: \r\n\r\nRe `opal -R server issue-1176.rb` - I had no idea, this is wonderful!"}}