{"action":"created","comment":{"url":"https://api.github.com/repos/kripken/emscripten/pulls/comments/153667277","pull_request_review_id":79707024,"id":153667277,"diff_hunk":"@@ -7596,6 +7596,57 @@ def test_binaryen_ignore_implicit_traps(self):\n       print('sizes:', sizes)\n       assert sizes[1] < sizes[0], 'ignoring implicit traps must reduce code size'\n \n+  def test_binaryen_methods(self):\n+    for method_init in ['interpret-asm2wasm', 'interpret-s-expr', 'asmjs', 'interpret-binary', 'asmjs,interpret-binary', 'interpret-binary,asmjs']:\n+      # check success and failure for simple modes, only success for combined/fallback ones\n+      for success in [1, 0] if ',' not in method_init else [1]:\n+        method = method_init\n+        command = [PYTHON, EMCC, '-o', 'a.wasm.js', '-s', 'BINARYEN=1', path_from_root('tests', 'hello_world.c')]\n+        command += ['-s', 'BINARYEN_METHOD=\"' + method + '\"']\n+        print([method, ' : ', ' '.join(command), ' => ', success])\n+        subprocess.check_call(command)\n+\n+        see_polyfill =  'var WasmJS = ' in open('a.wasm.js').read()\n+\n+        if method and 'interpret' not in method:\n+          assert not see_polyfill, 'verify polyfill was not added - we specified a method, and it does not need it'\n+        else:\n+          assert see_polyfill, 'we need the polyfill'\n+\n+        def break_cashew():\n+          asm = open('a.wasm.asm.js').read()\n+          asm = asm.replace('\"almost asm\"', '\"use asm\"; var not_in_asm = [].length + (true || { x: 5 }.x);')\n+          asm = asm.replace(\"'almost asm'\", '\"use asm\"; var not_in_asm = [].length + (true || { x: 5 }.x);')\n+          with open('a.wasm.asm.js', 'w') as o: o.write(asm)\n+        if method.startswith('interpret-asm2wasm'):\n+          try_delete('a.wasm.wast') # we should not need the .wast\n+          if not success:\n+            break_cashew() # we need cashew\n+        elif method.startswith('interpret-s-expr'):\n+          try_delete('a.wasm.asm.js') # we should not need the .asm.js\n+          if not success:\n+            try_delete('a.wasm.wast')\n+        elif method.startswith('asmjs'):\n+          try_delete('a.wasm.wast') # we should not need the .wast\n+          break_cashew() # we don't use cashew, so ok to break it\n+          if not success:\n+            try_delete('a.wasm.js')\n+        elif method.startswith('interpret-binary'):\n+          try_delete('a.wasm.wast') # we should not need the .wast\n+          try_delete('a.wasm.asm.js') # we should not need the .asm.js\n+          if not success:\n+            try_delete('a.wasm.wasm')\n+        else:\n+          1/0","path":"tests/test_other.py","position":null,"original_position":45,"commit_id":"6289ac116056405aeb39b7c23a19bd65022780a6","original_commit_id":"a206f23ac9621fe164cc0273299c27a843a11eef","user":{"login":"kripken","id":173661,"avatar_url":"https://avatars0.githubusercontent.com/u/173661?v=4","gravatar_id":"","url":"https://api.github.com/users/kripken","html_url":"https://github.com/kripken","followers_url":"https://api.github.com/users/kripken/followers","following_url":"https://api.github.com/users/kripken/following{/other_user}","gists_url":"https://api.github.com/users/kripken/gists{/gist_id}","starred_url":"https://api.github.com/users/kripken/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kripken/subscriptions","organizations_url":"https://api.github.com/users/kripken/orgs","repos_url":"https://api.github.com/users/kripken/repos","events_url":"https://api.github.com/users/kripken/events{/privacy}","received_events_url":"https://api.github.com/users/kripken/received_events","type":"User","site_admin":false},"body":"Ok ok, I wrote a proper throw ;)","created_at":"2017-11-29T00:49:14Z","updated_at":"2017-11-29T00:49:14Z","html_url":"https://github.com/kripken/emscripten/pull/5859#discussion_r153667277","pull_request_url":"https://api.github.com/repos/kripken/emscripten/pulls/5859","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/kripken/emscripten/pulls/comments/153667277"},"html":{"href":"https://github.com/kripken/emscripten/pull/5859#discussion_r153667277"},"pull_request":{"href":"https://api.github.com/repos/kripken/emscripten/pulls/5859"}},"in_reply_to_id":153656492},"pull_request":{"url":"https://api.github.com/repos/kripken/emscripten/pulls/5859","id":154955020,"html_url":"https://github.com/kripken/emscripten/pull/5859","diff_url":"https://github.com/kripken/emscripten/pull/5859.diff","patch_url":"https://github.com/kripken/emscripten/pull/5859.patch","issue_url":"https://api.github.com/repos/kripken/emscripten/issues/5859","number":5859,"state":"open","locked":false,"title":"Clean up wasm glue","user":{"login":"kripken","id":173661,"avatar_url":"https://avatars0.githubusercontent.com/u/173661?v=4","gravatar_id":"","url":"https://api.github.com/users/kripken","html_url":"https://github.com/kripken","followers_url":"https://api.github.com/users/kripken/followers","following_url":"https://api.github.com/users/kripken/following{/other_user}","gists_url":"https://api.github.com/users/kripken/gists{/gist_id}","starred_url":"https://api.github.com/users/kripken/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kripken/subscriptions","organizations_url":"https://api.github.com/users/kripken/orgs","repos_url":"https://api.github.com/users/kripken/repos","events_url":"https://api.github.com/users/kripken/events{/privacy}","received_events_url":"https://api.github.com/users/kripken/received_events","type":"User","site_admin":false},"body":" * Removes unneeded code from the wasm loading glue.\r\n * Ifdefs code not needed in the normal (just wasm-native case).\r\n * Add a comprehensive test for the modes.\r\n * Remove support for changing the binaryen mode at runtime. It hasn't actually worked in a while, and was never tested, and really isn't that important.","created_at":"2017-11-28T01:00:27Z","updated_at":"2017-11-29T00:49:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":"122aa002baf6e44bfd5e6ab6dd8bd9124bff35dd","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/kripken/emscripten/pulls/5859/commits","review_comments_url":"https://api.github.com/repos/kripken/emscripten/pulls/5859/comments","review_comment_url":"https://api.github.com/repos/kripken/emscripten/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kripken/emscripten/issues/5859/comments","statuses_url":"https://api.github.com/repos/kripken/emscripten/statuses/6289ac116056405aeb39b7c23a19bd65022780a6","head":{"label":"kripken:clean-wasm-glue","ref":"clean-wasm-glue","sha":"6289ac116056405aeb39b7c23a19bd65022780a6","user":{"login":"kripken","id":173661,"avatar_url":"https://avatars0.githubusercontent.com/u/173661?v=4","gravatar_id":"","url":"https://api.github.com/users/kripken","html_url":"https://github.com/kripken","followers_url":"https://api.github.com/users/kripken/followers","following_url":"https://api.github.com/users/kripken/following{/other_user}","gists_url":"https://api.github.com/users/kripken/gists{/gist_id}","starred_url":"https://api.github.com/users/kripken/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kripken/subscriptions","organizations_url":"https://api.github.com/users/kripken/orgs","repos_url":"https://api.github.com/users/kripken/repos","events_url":"https://api.github.com/users/kripken/events{/privacy}","received_events_url":"https://api.github.com/users/kripken/received_events","type":"User","site_admin":false},"repo":{"id":1357796,"name":"emscripten","full_name":"kripken/emscripten","owner":{"login":"kripken","id":173661,"avatar_url":"https://avatars0.githubusercontent.com/u/173661?v=4","gravatar_id":"","url":"https://api.github.com/users/kripken","html_url":"https://github.com/kripken","followers_url":"https://api.github.com/users/kripken/followers","following_url":"https://api.github.com/users/kripken/following{/other_user}","gists_url":"https://api.github.com/users/kripken/gists{/gist_id}","starred_url":"https://api.github.com/users/kripken/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kripken/subscriptions","organizations_url":"https://api.github.com/users/kripken/orgs","repos_url":"https://api.github.com/users/kripken/repos","events_url":"https://api.github.com/users/kripken/events{/privacy}","received_events_url":"https://api.github.com/users/kripken/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kripken/emscripten","description":"Emscripten: An LLVM-to-JavaScript Compiler","fork":false,"url":"https://api.github.com/repos/kripken/emscripten","forks_url":"https://api.github.com/repos/kripken/emscripten/forks","keys_url":"https://api.github.com/repos/kripken/emscripten/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kripken/emscripten/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kripken/emscripten/teams","hooks_url":"https://api.github.com/repos/kripken/emscripten/hooks","issue_events_url":"https://api.github.com/repos/kripken/emscripten/issues/events{/number}","events_url":"https://api.github.com/repos/kripken/emscripten/events","assignees_url":"https://api.github.com/repos/kripken/emscripten/assignees{/user}","branches_url":"https://api.github.com/repos/kripken/emscripten/branches{/branch}","tags_url":"https://api.github.com/repos/kripken/emscripten/tags","blobs_url":"https://api.github.com/repos/kripken/emscripten/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kripken/emscripten/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kripken/emscripten/git/refs{/sha}","trees_url":"https://api.github.com/repos/kripken/emscripten/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kripken/emscripten/statuses/{sha}","languages_url":"https://api.github.com/repos/kripken/emscripten/languages","stargazers_url":"https://api.github.com/repos/kripken/emscripten/stargazers","contributors_url":"https://api.github.com/repos/kripken/emscripten/contributors","subscribers_url":"https://api.github.com/repos/kripken/emscripten/subscribers","subscription_url":"https://api.github.com/repos/kripken/emscripten/subscription","commits_url":"https://api.github.com/repos/kripken/emscripten/commits{/sha}","git_commits_url":"https://api.github.com/repos/kripken/emscripten/git/commits{/sha}","comments_url":"https://api.github.com/repos/kripken/emscripten/comments{/number}","issue_comment_url":"https://api.github.com/repos/kripken/emscripten/issues/comments{/number}","contents_url":"https://api.github.com/repos/kripken/emscripten/contents/{+path}","compare_url":"https://api.github.com/repos/kripken/emscripten/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kripken/emscripten/merges","archive_url":"https://api.github.com/repos/kripken/emscripten/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kripken/emscripten/downloads","issues_url":"https://api.github.com/repos/kripken/emscripten/issues{/number}","pulls_url":"https://api.github.com/repos/kripken/emscripten/pulls{/number}","milestones_url":"https://api.github.com/repos/kripken/emscripten/milestones{/number}","notifications_url":"https://api.github.com/repos/kripken/emscripten/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kripken/emscripten/labels{/name}","releases_url":"https://api.github.com/repos/kripken/emscripten/releases{/id}","deployments_url":"https://api.github.com/repos/kripken/emscripten/deployments","created_at":"2011-02-12T05:23:30Z","updated_at":"2017-11-28T20:38:23Z","pushed_at":"2017-11-29T00:49:08Z","git_url":"git://github.com/kripken/emscripten.git","ssh_url":"git@github.com:kripken/emscripten.git","clone_url":"https://github.com/kripken/emscripten.git","svn_url":"https://github.com/kripken/emscripten","homepage":"","size":154523,"stargazers_count":13406,"watchers_count":13406,"language":"C","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1617,"mirror_url":null,"archived":false,"open_issues_count":1286,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":1617,"open_issues":1286,"watchers":13406,"default_branch":"incoming"}},"base":{"label":"kripken:incoming","ref":"incoming","sha":"fe3510ca5ebe65b388c4c85c2fc15f8995f7c8b1","user":{"login":"kripken","id":173661,"avatar_url":"https://avatars0.githubusercontent.com/u/173661?v=4","gravatar_id":"","url":"https://api.github.com/users/kripken","html_url":"https://github.com/kripken","followers_url":"https://api.github.com/users/kripken/followers","following_url":"https://api.github.com/users/kripken/following{/other_user}","gists_url":"https://api.github.com/users/kripken/gists{/gist_id}","starred_url":"https://api.github.com/users/kripken/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kripken/subscriptions","organizations_url":"https://api.github.com/users/kripken/orgs","repos_url":"https://api.github.com/users/kripken/repos","events_url":"https://api.github.com/users/kripken/events{/privacy}","received_events_url":"https://api.github.com/users/kripken/received_events","type":"User","site_admin":false},"repo":{"id":1357796,"name":"emscripten","full_name":"kripken/emscripten","owner":{"login":"kripken","id":173661,"avatar_url":"https://avatars0.githubusercontent.com/u/173661?v=4","gravatar_id":"","url":"https://api.github.com/users/kripken","html_url":"https://github.com/kripken","followers_url":"https://api.github.com/users/kripken/followers","following_url":"https://api.github.com/users/kripken/following{/other_user}","gists_url":"https://api.github.com/users/kripken/gists{/gist_id}","starred_url":"https://api.github.com/users/kripken/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kripken/subscriptions","organizations_url":"https://api.github.com/users/kripken/orgs","repos_url":"https://api.github.com/users/kripken/repos","events_url":"https://api.github.com/users/kripken/events{/privacy}","received_events_url":"https://api.github.com/users/kripken/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kripken/emscripten","description":"Emscripten: An LLVM-to-JavaScript Compiler","fork":false,"url":"https://api.github.com/repos/kripken/emscripten","forks_url":"https://api.github.com/repos/kripken/emscripten/forks","keys_url":"https://api.github.com/repos/kripken/emscripten/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kripken/emscripten/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kripken/emscripten/teams","hooks_url":"https://api.github.com/repos/kripken/emscripten/hooks","issue_events_url":"https://api.github.com/repos/kripken/emscripten/issues/events{/number}","events_url":"https://api.github.com/repos/kripken/emscripten/events","assignees_url":"https://api.github.com/repos/kripken/emscripten/assignees{/user}","branches_url":"https://api.github.com/repos/kripken/emscripten/branches{/branch}","tags_url":"https://api.github.com/repos/kripken/emscripten/tags","blobs_url":"https://api.github.com/repos/kripken/emscripten/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kripken/emscripten/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kripken/emscripten/git/refs{/sha}","trees_url":"https://api.github.com/repos/kripken/emscripten/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kripken/emscripten/statuses/{sha}","languages_url":"https://api.github.com/repos/kripken/emscripten/languages","stargazers_url":"https://api.github.com/repos/kripken/emscripten/stargazers","contributors_url":"https://api.github.com/repos/kripken/emscripten/contributors","subscribers_url":"https://api.github.com/repos/kripken/emscripten/subscribers","subscription_url":"https://api.github.com/repos/kripken/emscripten/subscription","commits_url":"https://api.github.com/repos/kripken/emscripten/commits{/sha}","git_commits_url":"https://api.github.com/repos/kripken/emscripten/git/commits{/sha}","comments_url":"https://api.github.com/repos/kripken/emscripten/comments{/number}","issue_comment_url":"https://api.github.com/repos/kripken/emscripten/issues/comments{/number}","contents_url":"https://api.github.com/repos/kripken/emscripten/contents/{+path}","compare_url":"https://api.github.com/repos/kripken/emscripten/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kripken/emscripten/merges","archive_url":"https://api.github.com/repos/kripken/emscripten/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kripken/emscripten/downloads","issues_url":"https://api.github.com/repos/kripken/emscripten/issues{/number}","pulls_url":"https://api.github.com/repos/kripken/emscripten/pulls{/number}","milestones_url":"https://api.github.com/repos/kripken/emscripten/milestones{/number}","notifications_url":"https://api.github.com/repos/kripken/emscripten/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kripken/emscripten/labels{/name}","releases_url":"https://api.github.com/repos/kripken/emscripten/releases{/id}","deployments_url":"https://api.github.com/repos/kripken/emscripten/deployments","created_at":"2011-02-12T05:23:30Z","updated_at":"2017-11-28T20:38:23Z","pushed_at":"2017-11-29T00:49:08Z","git_url":"git://github.com/kripken/emscripten.git","ssh_url":"git@github.com:kripken/emscripten.git","clone_url":"https://github.com/kripken/emscripten.git","svn_url":"https://github.com/kripken/emscripten","homepage":"","size":154523,"stargazers_count":13406,"watchers_count":13406,"language":"C","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1617,"mirror_url":null,"archived":false,"open_issues_count":1286,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":1617,"open_issues":1286,"watchers":13406,"default_branch":"incoming"}},"_links":{"self":{"href":"https://api.github.com/repos/kripken/emscripten/pulls/5859"},"html":{"href":"https://github.com/kripken/emscripten/pull/5859"},"issue":{"href":"https://api.github.com/repos/kripken/emscripten/issues/5859"},"comments":{"href":"https://api.github.com/repos/kripken/emscripten/issues/5859/comments"},"review_comments":{"href":"https://api.github.com/repos/kripken/emscripten/pulls/5859/comments"},"review_comment":{"href":"https://api.github.com/repos/kripken/emscripten/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kripken/emscripten/pulls/5859/commits"},"statuses":{"href":"https://api.github.com/repos/kripken/emscripten/statuses/6289ac116056405aeb39b7c23a19bd65022780a6"}},"author_association":"OWNER"}}
{"actor":{"display_login":"kripken"}}