-
-
Notifications
You must be signed in to change notification settings - Fork 35.2k
.load ignores last line of file when it doesn't include a newline. #47305
Copy link
Copy link
Closed
Labels
replIssues and PRs related to the REPL subsystem.Issues and PRs related to the REPL subsystem.
Description
Version
v19.8.1
Platform
Darwin 22.4.0 Darwin Kernel Version 22.4.0: Mon Mar 6 21:01:02 PST 2023; root:xnu-8796.101.5~3/RELEASE_ARM64_T8112 arm64
Subsystem
repl
What steps will reproduce the bug?
$ node
> fs.writeFileSync('foo.js', '{\n}')
undefined
> .load foo.js
{
...
(To be clear, it prompts for more text, it doesn't loop forever.)
How often does it reproduce? Is there a required condition?
Always
What is the expected behavior? Why is that the expected behavior?
> .load foo.js
{
}
{}
What do you see instead?
{
...
(To be clear, it prompts for more text, it doesn't loop forever.)
Additional information
This seems related to #46731.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
replIssues and PRs related to the REPL subsystem.Issues and PRs related to the REPL subsystem.