how to work around node.js dependencies?

I'm trying to interpret a javascript program generated by emscripten with rhino, but apparently the generated code depends on features of node.js, not covered by rhino. I get:

js: "d.js", line 1: uncaught JavaScript runtime exception: TypeError: Cannot call method "slice" of null

Probably because of this:

Module["arguments"]=process["argv"].slice(2)

How can I prevent emscripten to depend on node.js features, or somehow provide them to rhino?

My solution was to use the new javascript implementation from java 8, Nashorn. Everything apparently works when using that. Also, the fact that emscripten-generated code does not work under rhino, is due to a bug.