-
Notifications
You must be signed in to change notification settings - Fork 30.1k
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: implement constants and natives binding directly #48186
Conversation
This patch removes special case in the internal binding loader for natives, and implements it using the builtins internal binding. Internally we do not actually need the natives binding, so implement it as a legacy wrapper instead.
Review requested:
|
function isNativeUrl(url) { | ||
url = SideEffectFreeRegExpPrototypeSymbolReplace(/\.js$/, url, ''); | ||
|
||
return StringPrototypeStartsWith(url, 'node:internal/') || | ||
ArrayPrototypeIncludes(PUBLIC_BUILTINS, url) || | ||
url in NATIVES || url === 'bootstrap_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.
The original condition was already redundant, builtinIds
actually contains both public and internal IDs, so I just removed it (as well as bootstrap_node
which no longer exists)
Instead of adding a special case for it in the internal binding loader, just implement it as usual using a per-context property initializer.
This patch removes special case in the internal binding loader for natives, and implements it using the builtins internal binding. Internally we do not actually need the natives binding, so implement it as a legacy wrapper instead. PR-URL: #48186 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Instead of adding a special case for it in the internal binding loader, just implement it as usual using a per-context property initializer. PR-URL: #48186 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Landed in 6a3403c...d102f18 |
This patch removes special case in the internal binding loader for natives, and implements it using the builtins internal binding. Internally we do not actually need the natives binding, so implement it as a legacy wrapper instead. PR-URL: #48186 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Instead of adding a special case for it in the internal binding loader, just implement it as usual using a per-context property initializer. PR-URL: #48186 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
This patch removes special case in the internal binding loader for natives, and implements it using the builtins internal binding. Internally we do not actually need the natives binding, so implement it as a legacy wrapper instead. PR-URL: nodejs#48186 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Instead of adding a special case for it in the internal binding loader, just implement it as usual using a per-context property initializer. PR-URL: nodejs#48186 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
This patch removes special case in the internal binding loader for natives, and implements it using the builtins internal binding. Internally we do not actually need the natives binding, so implement it as a legacy wrapper instead. PR-URL: nodejs#48186 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Instead of adding a special case for it in the internal binding loader, just implement it as usual using a per-context property initializer. PR-URL: nodejs#48186 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
hi @joyeecheung these commits are not landing cleanly on |
src: implement natives binding without special casing
This patch removes special case in the internal binding loader
for natives, and implements it using the builtins internal
binding. Internally we do not actually need the natives binding,
so implement it as a legacy wrapper instead.
src: implement constants binding directly
Instead of adding a special case for it in the internal binding
loader, just implement it as usual using a per-context property
initializer.