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
{{ message }}
This repository has been archived by the owner on Apr 11, 2022. It is now read-only.
I'm trying to port some code over to JS Engine and have run into trouble in a couple cases
One of the scripts I have is a String, but JS Engine only takes a File. Internally, JS Engine takes this File and turns it into a FileReader. It'd be nice if it just took a Reader to start because then I could pass it a FileReader, StringReader, InputStreamReader, etc. The only thing here that we'd have to account for is taking a File gives us a script name, so we'd also want to add a parameter for an optional script name.
The second thing I've run into is that my code currently executes multiple scripts on the same engine. There's not a really good way to do that with JS Engine because a new engine is created for each script. I could probably just concatenate the scripts, but then it'd be harder to debug any errors because you'd get the line number for the concatenated script instead of the original file name and line number. Of course I'm doing this with the Javax engine. I don't know if there's a way to run multiple scripts in the same Node engine or not...
The text was updated successfully, but these errors were encountered:
I don't think switching toReader in the Engine interface is possible, since all the LocalEngine instances expect to be handed a script in the form of a path to a real file (Node, CommonNode, PhantomJs).
I'm trying to port some code over to JS Engine and have run into trouble in a couple cases
One of the scripts I have is a String, but JS Engine only takes a File. Internally, JS Engine takes this File and turns it into a FileReader. It'd be nice if it just took a Reader to start because then I could pass it a FileReader, StringReader, InputStreamReader, etc. The only thing here that we'd have to account for is taking a File gives us a script name, so we'd also want to add a parameter for an optional script name.
The second thing I've run into is that my code currently executes multiple scripts on the same engine. There's not a really good way to do that with JS Engine because a new engine is created for each script. I could probably just concatenate the scripts, but then it'd be harder to debug any errors because you'd get the line number for the concatenated script instead of the original file name and line number. Of course I'm doing this with the Javax engine. I don't know if there's a way to run multiple scripts in the same Node engine or not...
The text was updated successfully, but these errors were encountered: