opal/opal

IO reading process means you can't use execjs with V8

Open

#1539 aperta il 21 lug 2016

Vedi su GitHub
 (5 commenti) (0 reazioni) (0 assegnatari)Ruby (382 fork)batch import
corelibgood first issue

Metriche repository

Star
 (4766 star)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

execjs uses the process io stream to get the results from running an expression.

But opal detects the presence of the process object, and if it is there uses it rather than console.log for doing output via puts etc.

This means that if you are using execjs + V8 you can't do a puts !!!

I would favor reversing the order of the check so that if console is available, we use that, then if its not available we use the process object if its available, and finally if neither object is available, then we dump the output.

The problem is I can see this might be a breaking change.

Is there any way to have a patch that require a different approach while the former is deprecated? I tried some simplistic ways to override the implementation, but I couldn't get it to stick.

Guida contributor