mirror of
https://github.com/nodejs/node.git
synced 2025-08-15 13:48:44 +02:00
src: fix internalModuleStat v8 fast path
PR-URL: https://github.com/nodejs/node/pull/58054 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Robert Nagy <ronagy@icloud.com>
This commit is contained in:
parent
adc948af56
commit
5ed1bcbd9b
8 changed files with 37 additions and 27 deletions
|
@ -255,9 +255,9 @@ function stat(filename) {
|
|||
const result = statCache.get(filename);
|
||||
if (result !== undefined) { return result; }
|
||||
}
|
||||
const result = internalFsBinding.internalModuleStat(internalFsBinding, filename);
|
||||
const result = internalFsBinding.internalModuleStat(filename);
|
||||
if (statCache !== null && result >= 0) {
|
||||
// Only set cache when `internalModuleStat(internalFsBinding, filename)` succeeds.
|
||||
// Only set cache when `internalModuleStat(filename)` succeeds.
|
||||
statCache.set(filename, result);
|
||||
}
|
||||
return result;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue