lib: remove sources of permanent deopts
PR-URL: https://github.com/nodejs/node/pull/10789 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
This commit is contained in:
parent
1c3df96570
commit
a851b868c0
@ -1572,7 +1572,7 @@ fs.realpathSync = function realpathSync(p, options) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var resolvedLink;
|
var resolvedLink;
|
||||||
const maybeCachedResolved = cache && cache.get(base);
|
var maybeCachedResolved = cache && cache.get(base);
|
||||||
if (maybeCachedResolved) {
|
if (maybeCachedResolved) {
|
||||||
resolvedLink = maybeCachedResolved;
|
resolvedLink = maybeCachedResolved;
|
||||||
} else {
|
} else {
|
||||||
@ -1585,8 +1585,8 @@ fs.realpathSync = function realpathSync(p, options) {
|
|||||||
|
|
||||||
// read the link if it wasn't read before
|
// read the link if it wasn't read before
|
||||||
// dev/ino always return 0 on windows, so skip the check.
|
// dev/ino always return 0 on windows, so skip the check.
|
||||||
let linkTarget = null;
|
var linkTarget = null;
|
||||||
let id;
|
var id;
|
||||||
if (!isWindows) {
|
if (!isWindows) {
|
||||||
id = `${stat.dev.toString(32)}:${stat.ino.toString(32)}`;
|
id = `${stat.dev.toString(32)}:${stat.ino.toString(32)}`;
|
||||||
if (seenLinks.hasOwnProperty(id)) {
|
if (seenLinks.hasOwnProperty(id)) {
|
||||||
|
@ -179,7 +179,7 @@ Module._findPath = function(request, paths, isMain) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var exts;
|
var exts;
|
||||||
const trailingSlash = request.length > 0 &&
|
var trailingSlash = request.length > 0 &&
|
||||||
request.charCodeAt(request.length - 1) === 47/*/*/;
|
request.charCodeAt(request.length - 1) === 47/*/*/;
|
||||||
|
|
||||||
// For each path
|
// For each path
|
||||||
@ -190,7 +190,7 @@ Module._findPath = function(request, paths, isMain) {
|
|||||||
var basePath = path.resolve(curPath, request);
|
var basePath = path.resolve(curPath, request);
|
||||||
var filename;
|
var filename;
|
||||||
|
|
||||||
const rc = stat(basePath);
|
var rc = stat(basePath);
|
||||||
if (!trailingSlash) {
|
if (!trailingSlash) {
|
||||||
if (rc === 0) { // File.
|
if (rc === 0) { // File.
|
||||||
if (preserveSymlinks && !isMain) {
|
if (preserveSymlinks && !isMain) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user