You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First of all, thanks for all the work on this project!
I tried out Transcript and the end of each generated .js file looks like this:
window['test']=test();
This fails on Node.js because there is no window object when running javascript on the server:
$ node __javascript__/test.js
/Users/ageitgey/Desktop/__javascript__/test.js:977
window ['test'] = test ();
^
ReferenceError: window is not defined
To make the generated code work on Node.js, all you have to do is remove is this:
// Original codewindow['test']=test();// Change to:test();
I know your main use case might be to generate .js to run in the browser. But would it be possible to support generating code that doesn't assume there is a window object? Maybe it could be done via an optional parameter if you prefer the current behavior?
The text was updated successfully, but these errors were encountered:
I think it's a good idea to make it useable in node.js as well, e.g. in case people want to use it on the desktop instead of CPython for easy access to JS libs.
First of all, thanks for all the work on this project!
I tried out Transcript and the end of each generated .js file looks like this:
This fails on Node.js because there is no
window
object when running javascript on the server:To make the generated code work on Node.js, all you have to do is remove is this:
I know your main use case might be to generate .js to run in the browser. But would it be possible to support generating code that doesn't assume there is a
window
object? Maybe it could be done via an optional parameter if you prefer the current behavior?The text was updated successfully, but these errors were encountered: