-
Notifications
You must be signed in to change notification settings - Fork 30.9k
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
src: port defineLazyProperties
to native code
#57081
src: port defineLazyProperties
to native code
#57081
Conversation
This allows us to have getters not observable from JS side.
Review requested:
|
Co-authored-by: James M Snell <jasnell@gmail.com>
Isolate* isolate = args.GetIsolate(); | ||
auto target = args[0].As<Object>(); | ||
|
||
if (target |
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 think instead of doing it in JS -> C++, we might as well just do it in BootstrapRealm()
implementations directly.
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'll try to do it in a follow up if no one beats me to it
This reverts commit af7bb75.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #57081 +/- ##
==========================================
- Coverage 89.08% 89.06% -0.02%
==========================================
Files 665 665
Lines 193248 193273 +25
Branches 37229 37235 +6
==========================================
- Hits 172157 172141 -16
- Misses 13806 13815 +9
- Partials 7285 7317 +32
|
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.
LGTM with a suggestion, can be done in a follow up though
auto context = isolate->GetCurrentContext(); | ||
Local<Value> arg = info.Data(); | ||
Local<Value> require_result; | ||
if (!realm->builtin_module_require() |
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.
It might be worth to cache the modules in C++ or just pass the BuiltinModule.map
to C++ land so that multiple exports from the same module do not lead to repeated call backs into the JS require
.
Landed in 2086877 |
This allows us to have getters not observable from JS side. PR-URL: nodejs#57081 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
This allows us to have getters not observable from JS side. PR-URL: #57081 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
This allows us to have getters not observable from JS side. PR-URL: #57081 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
This allows us to have getters not observable from JS side, getting our implementation closer to the other runtimes.