-
Notifications
You must be signed in to change notification settings - Fork 0
Add environment to all library methods #82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
* @return The return value of the given JavaScript file. | ||
*/ | ||
NODE_EXTERN v8::MaybeLocal<v8::Value> Run(const std::string& path); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add documentation.
Would it be a good idea to check, whether we can use |
I don't think we can easily change our Initialize function to accomplish this, because it initializes a lot more than just the environment ( |
src/node_lib.h
Outdated
NODE_EXTERN v8::MaybeLocal<v8::Value> Call( | ||
Environment* env, | ||
v8::Local<v8::Object> receiver, | ||
v8::Local<v8::Function> function, | ||
std::initializer_list<v8::Local<v8::Value>> args); | ||
} // namespace node |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happened here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, that was an accident, fixed it 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was just working on the same thing when you started pushing :-D I've now also pushed my commit, which should make this ready.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The env parameter has to be added to eventLoopIsRunning, start/stopEventLoop and tickEventLoop, too, and the documentation for internal::isolate()/environment() should be adapted.
I will stop working on it now so that we don't do it twice again :-D 🙈
I'm not sure that's true. Calling tickEventLoop with a different environment meanse calling it with an environment not created by
Yes, that's right. |
I'm not sure about this, but shouldn't it be possible to call startEventLoop(env) with an environment created in the same way as in Initialize()? If not, than this parameter is not required, right. We should then document that it is using the env from the Initialize() function. |
Well, I think it would be possible in theory, but not worth the hassle at the moment. If you are that advanced to create own environments without using the Initialize function, you might as well write your own event loop. |
Merging based on feedback received on Telegram 🔭 |
No description provided.