{"action":"created","issue":{"url":"https://api.github.com/repos/kripken/emscripten/issues/3821","labels_url":"https://api.github.com/repos/kripken/emscripten/issues/3821/labels{/name}","comments_url":"https://api.github.com/repos/kripken/emscripten/issues/3821/comments","events_url":"https://api.github.com/repos/kripken/emscripten/issues/3821/events","html_url":"https://github.com/kripken/emscripten/issues/3821","id":108455146,"number":3821,"title":"Clarify Environments in shell.js","user":{"login":"rodneyrehm","id":186837,"avatar_url":"https://avatars.githubusercontent.com/u/186837?v=3","gravatar_id":"","url":"https://api.github.com/users/rodneyrehm","html_url":"https://github.com/rodneyrehm","followers_url":"https://api.github.com/users/rodneyrehm/followers","following_url":"https://api.github.com/users/rodneyrehm/following{/other_user}","gists_url":"https://api.github.com/users/rodneyrehm/gists{/gist_id}","starred_url":"https://api.github.com/users/rodneyrehm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rodneyrehm/subscriptions","organizations_url":"https://api.github.com/users/rodneyrehm/orgs","repos_url":"https://api.github.com/users/rodneyrehm/repos","events_url":"https://api.github.com/users/rodneyrehm/events{/privacy}","received_events_url":"https://api.github.com/users/rodneyrehm/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-09-26T10:53:05Z","updated_at":"2015-09-26T21:29:45Z","closed_at":null,"body":"I've stumbled across this because of medialize/sass.js#36.\r\n\r\nIt looks as if the emscripten runtime identifies `WEB`, `NODE`, `WORKER`, `PTHREAD` (??), `SHELL` (??) as execution environments. Apparently people like to use emscripted projects in Java using [Rhino](https://en.wikipedia.org/wiki/Rhino_%28JavaScript_engine%29) or [Nashorn](https://en.wikipedia.org/wiki/Nashorn_%28JavaScript_engine%29), because that prevents them from having to deal with JNI (or so I assume, I'm not a Java developer). Also there are a [few more JS engines](https://en.wikipedia.org/wiki/List_of_ECMAScript_engines) - most of which I've never heard before.\r\n\r\nsass.js is failing on Rhino either because of #2601 or because Rhino was identified as `SHELL` and then fails because of the missing [global print](https://github.com/kripken/emscripten/blob/master/src/shell.js#L108). I have no idea what `SHELL` is supposed to be and I don't know if Rhino should be considered `NODE` or not.\r\n\r\n* is it possible to extract / refactor the environment stuff to make it clear to\r\n  * make it clear what part of the environment is actually required\r\n  * it becomes \"easily\" exensible for \"niche\" runtimes\r\n* should compilation accept a flag to specify the target environment (node doesn't need the web stuff and vice versa) for optional optimization\r\n* are there any tests for the envirnments so that we (the victims of \"niche\" environments) could start looking at what actually needs to be done?"},"comment":{"url":"https://api.github.com/repos/kripken/emscripten/issues/comments/143497597","html_url":"https://github.com/kripken/emscripten/issues/3821#issuecomment-143497597","issue_url":"https://api.github.com/repos/kripken/emscripten/issues/3821","id":143497597,"user":{"login":"rodneyrehm","id":186837,"avatar_url":"https://avatars.githubusercontent.com/u/186837?v=3","gravatar_id":"","url":"https://api.github.com/users/rodneyrehm","html_url":"https://github.com/rodneyrehm","followers_url":"https://api.github.com/users/rodneyrehm/followers","following_url":"https://api.github.com/users/rodneyrehm/following{/other_user}","gists_url":"https://api.github.com/users/rodneyrehm/gists{/gist_id}","starred_url":"https://api.github.com/users/rodneyrehm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rodneyrehm/subscriptions","organizations_url":"https://api.github.com/users/rodneyrehm/orgs","repos_url":"https://api.github.com/users/rodneyrehm/repos","events_url":"https://api.github.com/users/rodneyrehm/events{/privacy}","received_events_url":"https://api.github.com/users/rodneyrehm/received_events","type":"User","site_admin":false},"created_at":"2015-09-26T21:29:45Z","updated_at":"2015-09-26T21:29:45Z","body":"thank you guys! closing this for now… :)"}}