| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent e1bebf1 commit b894df8
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -31,6 +31,7 @@ const kIoMaxLength = 2 ** 31 - 1; | |||
| 31 | 31 | const { | |
| 32 | 32 | Map, | |
| 33 | 33 | MathMax, | |
| 34 | + Number, | ||
| 34 | 35 | NumberIsSafeInteger, | |
| 35 | 36 | ObjectCreate, | |
| 36 | 37 | ObjectDefineProperties, | |
@@ -182,7 +183,10 @@ const isFd = isUint32; | |||
| 182 | 183 | function isFileType(stats, fileType) { | |
| 183 | 184 | // Use stats array directly to avoid creating an fs.Stats instance just for | |
| 184 | 185 | // our internal use. | |
| 185 | - return (stats[1/* mode */] & S_IFMT) === fileType; | ||
| 186 | + let mode = stats[1]; | ||
| 187 | + if (typeof mode === 'bigint') | ||
| 188 | + mode = Number(mode); | ||
| 189 | + return (mode & S_IFMT) === fileType; | ||
| 186 | 190 | } | |
| 187 | 191 | ||
| 188 | 192 | function access(path, mode, callback) { | |
@@ -1672,7 +1676,7 @@ function realpathSync(p, options) { | |||
| 1672 | 1676 | ||
| 1673 | 1677 | const baseLong = pathModule.toNamespacedPath(base); | |
| 1674 | 1678 | const ctx = { path: base }; | |
| 1675 | - const stats = binding.lstat(baseLong, false, undefined, ctx); | ||
| 1679 | + const stats = binding.lstat(baseLong, true, undefined, ctx); | ||
| 1676 | 1680 | handleErrorFromBinding(ctx); | |
| 1677 | 1681 | ||
| 1678 | 1682 | if (!isFileType(stats, S_IFLNK)) { | |
@@ -1805,7 +1809,7 @@ function realpath(p, options, callback) { | |||
| 1805 | 1809 | return process.nextTick(LOOP); | |
| 1806 | 1810 | } | |
| 1807 | 1811 | ||
| 1808 | - return fs.lstat(base, gotStat); | ||
| 1812 | + return fs.lstat(base, { bigint: true }, gotStat); | ||
| 1809 | 1813 | } | |
| 1810 | 1814 | ||
| 1811 | 1815 | function gotStat(err, stats) { | |
| Back | FazBrowse Home | New Git URL |
0 commit comments