-
-
Notifications
You must be signed in to change notification settings - Fork 31.8k
src: add public wrapper for Environment::GetCurrent #23676
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -265,6 +265,9 @@ NODE_EXTERN Environment* CreateEnvironment(IsolateData* isolate_data, | |||
NODE_EXTERN void LoadEnvironment(Environment* env); | ||||
NODE_EXTERN void FreeEnvironment(Environment* env); | ||||
|
||||
// This may return nullptr if context is not associated with a Node instance. | ||||
NODE_EXTERN Environment* GetCurrentEnvironment(v8::Local<v8::Context> context); | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A question: What is the benefit of this without the Line 25 in 1a2cf66
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For one, you can test whether the current Context is a Node.js one or not, which is what electron does, I think. Secondly, There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The only caveat is that we need forward declarations: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Now that I think of it, this might be way part of the reason I'm having trouble "embedded" node into node in #23439. |
||||
|
||||
// This returns the MultiIsolatePlatform used in the main thread of Node.js. | ||||
// If NODE_USE_V8_PLATFORM haven't been defined when Node.js was built, | ||||
// it returns nullptr. | ||||
|
Uh oh!
There was an error while loading. Please reload this page.