| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -181,7 +181,7 @@ function maybeCallback(cb) { | |||
| 181 | 181 | function makeCallback(cb) { | |
| 182 | 182 | validateCallback(cb); | |
| 183 | 183 | ||
| 184 | - return (...args) => cb(...args); | ||
| 184 | + return (...args) => ReflectApply(cb, this, args); | ||
| 185 | 185 | } | |
| 186 | 186 | ||
| 187 | 187 | // Special case of `makeCallback()` that is specific to async `*stat()` calls as | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -99,7 +99,7 @@ class Dir { | |||
| 99 | 99 | } | |
| 100 | 100 | ||
| 101 | 101 | if (this[kDirBufferedEntries].length > 0) { | |
| 102 | - const [ name, type ] = | ||
| 102 | + const { 0: name, 1: type } = | ||
| 103 | 103 | ArrayPrototypeSplice(this[kDirBufferedEntries], 0, 2); | |
| 104 | 104 | if (maybeSync) | |
| 105 | 105 | process.nextTick(getDirent, this[kDirPath], name, type, callback); | |
@@ -142,7 +142,7 @@ class Dir { | |||
| 142 | 142 | } | |
| 143 | 143 | ||
| 144 | 144 | if (this[kDirBufferedEntries].length > 0) { | |
| 145 | - const [ name, type ] = | ||
| 145 | + const { 0: name, 1: type } = | ||
| 146 | 146 | ArrayPrototypeSplice(this[kDirBufferedEntries], 0, 2); | |
| 147 | 147 | return getDirent(this[kDirPath], name, type); | |
| 148 | 148 | } | |
@@ -182,7 +182,7 @@ class Dir { | |||
| 182 | 182 | } | |
| 183 | 183 | ||
| 184 | 184 | if (this[kDirOperationQueue] !== null) { | |
| 185 | - this[kDirOperationQueue].push(() => { | ||
| 185 | + ArrayPrototypePush(this[kDirOperationQueue], () => { | ||
| 186 | 186 | this.close(callback); | |
| 187 | 187 | }); | |
| 188 | 188 | return; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -19,6 +19,7 @@ const { | |||
| 19 | 19 | PromisePrototypeFinally, | |
| 20 | 20 | PromisePrototypeThen, | |
| 21 | 21 | PromiseResolve, | |
| 22 | + SafeArrayIterator, | ||
| 22 | 23 | Symbol, | |
| 23 | 24 | Uint8Array, | |
| 24 | 25 | } = primordials; | |
@@ -263,7 +264,7 @@ async function fsCall(fn, handle, ...args) { | |||
| 263 | 264 | ||
| 264 | 265 | try { | |
| 265 | 266 | handle[kRef](); | |
| 266 | - return await fn(handle, ...args); | ||
| 267 | + return await fn(handle, ...new SafeArrayIterator(args)); | ||
| 267 | 268 | } finally { | |
| 268 | 269 | handle[kUnref](); | |
| 269 | 270 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -217,7 +217,7 @@ function join(path, name) { | |||
| 217 | 217 | 'path', ['string', 'Buffer'], path); | |
| 218 | 218 | } | |
| 219 | 219 | ||
| 220 | - function getDirents(path, [names, types], callback) { | ||
| 220 | + function getDirents(path, { 0: names, 1: types }, callback) { | ||
| 221 | 221 | let i; | |
| 222 | 222 | if (typeof callback === 'function') { | |
| 223 | 223 | const len = names.length; | |
| Back | FazBrowse Home | New Git URL |
0 commit comments