GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — src: reduce duplication through consolidation by jasnell · Pull Request #67497 · nodejs/node ConversationThe MX, CAA, TLSA, TXT, SRV, and NAPTR reply parsers each repeated the same structure: lazily create the record dictionary template, parse the reply, iterate the answer section filtering by record type, build and append each record, and report ENODATA when nothing matched. Factor that into GetRecordTemplate(), ForEachAnswer(), and AppendRecord() helpers so each parser only contains its record-specific extraction. Behavior is unchanged, including TLSA results being indexed by answer position and never reporting ENODATA. Assisted-by: Claude Signed-off-by: James M Snell <[email protected]> Eleven snapshotable binding data classes implemented Deserialize() with the same sequence of opening a handle scope, looking up the Realm, and recreating the binding data on the holder, and six of them implemented Serialize() by handing over the InternalFieldInfo allocated in PrepareForSerialization(). Add Realm::DeserializeBindingData() and TakeInternalFieldInfo() helpers and use them. Assisted-by: Claude Signed-off-by: James M Snell <[email protected]> Eleven fs bindings (stat, statfs, link, rename, unlink, realpath, readdir, copyFile, chown, lchown, mkdtemp) repeated every permission check in both the asynchronous and the synchronous branch, differing only in whether the denial is reported through the request or thrown. Obtain the request wrap up front with a new GetAsyncReqWrap() helper and perform each check once with FS_THROW_IF_INSUFFICIENT_PERMISSIONS(), which picks the reporting style based on whether the call is async. How permission denials are reported is unchanged. Assisted-by: Claude Signed-off-by: James M Snell <[email protected]> Replace the repeated `if (argc > N) { req = GetReqWrap(args, N);
CHECK_NOT_NULL(req); ...` prologue of the fs bindings that select the
asynchronous path by argument count with GetAsyncReqWrap().
Assisted-by: Claude
Signed-off-by: James M Snell <[email protected]>
Collaborator
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
gurgunday
approved these changes
Member
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. lgtm
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
|
There was an error while loading. Please reload this page.
|
CI: https://ci.nodejs.org/job/node-test-pull-request/79132/ 💚 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@ ## main #67497 +/- ## ========================================== + Coverage 90.67% 90.70% +0.03% ========================================== Files 799 799 Lines 280245 280039 -206 Branches 54125 54028 -97 ========================================== - Hits 254100 254014 -86 + Misses 16280 16215 -65 + Partials 9865 9810 -55
🚀 New features to boost your workflow:
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
rslgtm
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Landed in a625b01...2aa3762 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
The MX, CAA, TLSA, TXT, SRV, and NAPTR reply parsers each repeated the same structure: lazily create the record dictionary template, parse the reply, iterate the answer section filtering by record type, build and append each record, and report ENODATA when nothing matched. Factor that into GetRecordTemplate(), ForEachAnswer(), and AppendRecord() helpers so each parser only contains its record-specific extraction. Behavior is unchanged, including TLSA results being indexed by answer position and never reporting ENODATA. Assisted-by: Claude Signed-off-by: James M Snell <[email protected]> PR-URL: #67497 Reviewed-By: Gürgün Dayıoğlu <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
Eleven snapshotable binding data classes implemented Deserialize() with the same sequence of opening a handle scope, looking up the Realm, and recreating the binding data on the holder, and six of them implemented Serialize() by handing over the InternalFieldInfo allocated in PrepareForSerialization(). Add Realm::DeserializeBindingData() and TakeInternalFieldInfo() helpers and use them. Assisted-by: Claude Signed-off-by: James M Snell <[email protected]> PR-URL: #67497 Reviewed-By: Gürgün Dayıoğlu <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
Eleven fs bindings (stat, statfs, link, rename, unlink, realpath, readdir, copyFile, chown, lchown, mkdtemp) repeated every permission check in both the asynchronous and the synchronous branch, differing only in whether the denial is reported through the request or thrown. Obtain the request wrap up front with a new GetAsyncReqWrap() helper and perform each check once with FS_THROW_IF_INSUFFICIENT_PERMISSIONS(), which picks the reporting style based on whether the call is async. How permission denials are reported is unchanged. Assisted-by: Claude Signed-off-by: James M Snell <[email protected]> PR-URL: #67497 Reviewed-By: Gürgün Dayıoğlu <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
Replace the repeated `if (argc > N) { req = GetReqWrap(args, N);
CHECK_NOT_NULL(req); ...` prologue of the fs bindings that select the
asynchronous path by argument count with GetAsyncReqWrap().
Assisted-by: Claude
Signed-off-by: James M Snell <[email protected]>
PR-URL: #67497
Reviewed-By: Gürgün Dayıoğlu <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
The MX, CAA, TLSA, TXT, SRV, and NAPTR reply parsers each repeated the same structure: lazily create the record dictionary template, parse the reply, iterate the answer section filtering by record type, build and append each record, and report ENODATA when nothing matched. Factor that into GetRecordTemplate(), ForEachAnswer(), and AppendRecord() helpers so each parser only contains its record-specific extraction. Behavior is unchanged, including TLSA results being indexed by answer position and never reporting ENODATA. Assisted-by: Claude Signed-off-by: James M Snell <[email protected]> PR-URL: #67497 Reviewed-By: Gürgün Dayıoğlu <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
Eleven snapshotable binding data classes implemented Deserialize() with the same sequence of opening a handle scope, looking up the Realm, and recreating the binding data on the holder, and six of them implemented Serialize() by handing over the InternalFieldInfo allocated in PrepareForSerialization(). Add Realm::DeserializeBindingData() and TakeInternalFieldInfo() helpers and use them. Assisted-by: Claude Signed-off-by: James M Snell <[email protected]> PR-URL: #67497 Reviewed-By: Gürgün Dayıoğlu <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
Eleven fs bindings (stat, statfs, link, rename, unlink, realpath, readdir, copyFile, chown, lchown, mkdtemp) repeated every permission check in both the asynchronous and the synchronous branch, differing only in whether the denial is reported through the request or thrown. Obtain the request wrap up front with a new GetAsyncReqWrap() helper and perform each check once with FS_THROW_IF_INSUFFICIENT_PERMISSIONS(), which picks the reporting style based on whether the call is async. How permission denials are reported is unchanged. Assisted-by: Claude Signed-off-by: James M Snell <[email protected]> PR-URL: #67497 Reviewed-By: Gürgün Dayıoğlu <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
Replace the repeated `if (argc > N) { req = GetReqWrap(args, N);
CHECK_NOT_NULL(req); ...` prologue of the fs bindings that select the
asynchronous path by argument count with GetAsyncReqWrap().
Assisted-by: Claude
Signed-off-by: James M Snell <[email protected]>
PR-URL: #67497
Reviewed-By: Gürgün Dayıoğlu <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
The MX, CAA, TLSA, TXT, SRV, and NAPTR reply parsers each repeated the same structure: lazily create the record dictionary template, parse the reply, iterate the answer section filtering by record type, build and append each record, and report ENODATA when nothing matched. Factor that into GetRecordTemplate(), ForEachAnswer(), and AppendRecord() helpers so each parser only contains its record-specific extraction. Behavior is unchanged, including TLSA results being indexed by answer position and never reporting ENODATA. Assisted-by: Claude Signed-off-by: James M Snell <[email protected]> PR-URL: nodejs#67497 Reviewed-By: Gürgün Dayıoğlu <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
Eleven snapshotable binding data classes implemented Deserialize() with the same sequence of opening a handle scope, looking up the Realm, and recreating the binding data on the holder, and six of them implemented Serialize() by handing over the InternalFieldInfo allocated in PrepareForSerialization(). Add Realm::DeserializeBindingData() and TakeInternalFieldInfo() helpers and use them. Assisted-by: Claude Signed-off-by: James M Snell <[email protected]> PR-URL: nodejs#67497 Reviewed-By: Gürgün Dayıoğlu <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
Eleven fs bindings (stat, statfs, link, rename, unlink, realpath, readdir, copyFile, chown, lchown, mkdtemp) repeated every permission check in both the asynchronous and the synchronous branch, differing only in whether the denial is reported through the request or thrown. Obtain the request wrap up front with a new GetAsyncReqWrap() helper and perform each check once with FS_THROW_IF_INSUFFICIENT_PERMISSIONS(), which picks the reporting style based on whether the call is async. How permission denials are reported is unchanged. Assisted-by: Claude Signed-off-by: James M Snell <[email protected]> PR-URL: nodejs#67497 Reviewed-By: Gürgün Dayıoğlu <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
Replace the repeated `if (argc > N) { req = GetReqWrap(args, N);
CHECK_NOT_NULL(req); ...` prologue of the fs bindings that select the
asynchronous path by argument count with GetAsyncReqWrap().
Assisted-by: Claude
Signed-off-by: James M Snell <[email protected]>
PR-URL: nodejs#67497
Reviewed-By: Gürgün Dayıoğlu <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.