Closed giacecco closed 3 years ago
quickjs gives two options to an embedder:
import
directive, but removes the ability for the embedding program to access any variables or functions in the codeimport
directive, but allows the embedding program to access variables and functions in the codesince it's a prototype hard requirement to be able to access the variables and call process(block)
, option two was the only viable approach. this is a decision that quickjs made in the beginning, and embedders can only choose on of these.
Clear, thanks @JerrySievert , so there is no solution to my problem, unless I write native C++ modules? Perhaps the situation is different for the other scripting languages?
You can check to see what the lua interpreter offers, but I haven’t looked into it myself (most of the interpreters were added by different people)
I don't know Lua much but I've just tried and observed the same issue: I cannot reference the runtime object providing HTTP functionality 😕
By checking on the source code I see that Prototype uses QuickJS as its JavaScript interpreter. However, I also see that some of QuickJS' context is missing, or at least I can't get it to work, e.g. I can't do something that should be correct in QuickJS, that is:
... because I get a strange
SyntaxError: expecting '('
error.My guess is that Prototype's developers have crippled some of the runtime and context, probably in the interest of performance / stability: is that so?
If you are curious, what I wanted to write for Prototype is a sequencer that interacted via the internet with a crowd of users, but to do that I would need to use QuickJS'
std.urlGet
.Thanks for any suggestions,
G.