Skip to content
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

NodeJS REPL integration swallows errors #106

Closed
LPTK opened this issue Apr 23, 2022 · 3 comments
Closed

NodeJS REPL integration swallows errors #106

LPTK opened this issue Apr 23, 2022 · 3 comments
Assignees
Labels
tooling Tooling and programming experience

Comments

@LPTK
Copy link
Contributor

LPTK commented Apr 23, 2022

As we've seen before, such as here: #65 (comment)

When there is a top-level syntax error in the NodeJS REPL, nothing in the test output indicates that anything is wrong. Even the :ShowREPL option does not show the syntax error output.

We should have a way of more effectively debugging such issues. Ideally by properly reporting the error, though that may be annoying to implement. At the very least, :ShowREPL should let us know what's going on by printing all the NodeJS output.

@LPTK
Copy link
Contributor Author

LPTK commented Aug 31, 2022

BTW @chengluyu isn't this fixed now?

@LPTK LPTK moved this to 👀 In review in MLscript backlog Aug 31, 2022
@chengluyu
Copy link
Member

chengluyu commented Sep 8, 2022

Yes. It’s fixed. Note that console.log still outputs nothing because it's mixed in the output. For example,

()
//│ res: ()
//│    = []

:escape
def console: { log: anything -> undefined }
//│ console: {log: anything -> undefined}
//│        = <missing implementation>

:ShowRepl
console.log "hello"
//│ ┌ Block at Repro.mls:9
//│ ├── No prelude
//│ └─┬ Query 1/1
//│   ├── Prelude: <empty>
//│   ├── Code: res = console.log("hello");
//│   ├── Intermediate: hello
//│ undefined
//│   └── Reply: [success] undefined
//│ res: undefined
//│    = undefined

But as you commented in #65, Tony made a helper function at ecca9d8

@LPTK
Copy link
Contributor Author

LPTK commented Sep 8, 2022

Ok, thanks for the follow-up.

@LPTK LPTK closed this as completed Sep 8, 2022
@LPTK LPTK moved this from 👀 In review to ✅ Done in MLscript backlog Sep 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tooling Tooling and programming experience
Projects
Status: Done
Development

No branches or pull requests

2 participants