-
Notifications
You must be signed in to change notification settings - Fork 29.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
node:fs/promises - throw new ERR_INTERNAL_ASSERTION(message); #50720
Comments
IMO, shouldn't we pass (async () => {
const file = await open("./text.txt", 'a+')
let count = 0
while(count < 5) {
await makeAppend(file.appendFile.bind(file))
count++
}
await makeAppend(file.appendFile.bind(file))
await file.close()
})();
async function makeAppend(appendFn) {
console.log("here", appendFn) // <--- prints
await appendFn(`hi there`)
console.log("here") <-- doesn't make it here
} //Prints :
here [Function: bound appendFile]
here
here [Function: bound appendFile]
here
here [Function: bound appendFile]
here
here [Function: bound appendFile]
here
here [Function: bound appendFile]
here
here [Function: bound appendFile]
here |
That is fair that is probably the right approach. I originally got the second error first and was playing around with different ways to solve it and got the first error that said to report to node. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Version
v21.1.0
Platform
6.2.0-36-generic #37~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Mon Oct 9 15:34:04 UTC 2 x86_64 x86_64 x86_64 GNU/Linux
Subsystem
No response
What steps will reproduce the bug?
How often does it reproduce? Is there a required condition?
I was able to reproduce on v18.x lts, all the way up to the current release.
What is the expected behavior? Why is that the expected behavior?
I would have expected to be able to pass the function from the fileHandler into another function.
What do you see instead?
Additional information
If I run the file without the
.bind(this)
i get the followingscript
The text was updated successfully, but these errors were encountered: