镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

.load ignores last line of file when it doesn't include a newline. #47305

Description

@harrisi

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.

Activity

  1. added
    replIssues and PRs related to the REPL subsystem.
    on Mar 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    replIssues and PRs related to the REPL subsystem.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions