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

REPL support for Symbol, undefined, NaN, and infinities #2278

Closed
Chris-Hibbert opened this issue Jan 28, 2021 · 0 comments · Fixed by #3083
Closed

REPL support for Symbol, undefined, NaN, and infinities #2278

Chris-Hibbert opened this issue Jan 28, 2021 · 0 comments · Fixed by #3083
Labels
bug Something isn't working enhancement New feature or request

Comments

@Chris-Hibbert
Copy link
Contributor

What is the Problem Being Solved?

in #2261, the REPL's stringify() was fixed to support BigInts, and @erights observed that it would fail similarly for symbols, undefined, NaN, Infinity, and -Infinity "all of which are primitive values that don't encode in JSON."

Description of the Design

Replace the special case branch with a replacer in the JSON.stringify() call that handles all these primitives.

Security Considerations

The REPL won't be able to report values containing these kinds of primitives. This results in an error, so it won't go unnoticed.

Test Plan

Added a failing test for NaN in test-repl.js

@Chris-Hibbert Chris-Hibbert added bug Something isn't working enhancement New feature or request labels Jan 28, 2021
@Chris-Hibbert Chris-Hibbert added this to the Beta Launch milestone Jan 28, 2021
@rowgraus rowgraus removed this from the Beta Initial Launch milestone Mar 29, 2021
michaelfig added a commit that referenced this issue May 13, 2021
fix(repl): render the unjsonable things described in #2278
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants