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

Panic when no arguments are given to JSON.parse #784

Closed
dapper-gh opened this issue Oct 3, 2020 · 0 comments · Fixed by #785
Closed

Panic when no arguments are given to JSON.parse #784

dapper-gh opened this issue Oct 3, 2020 · 0 comments · Fixed by #785
Labels
bug Something isn't working

Comments

@dapper-gh
Copy link

Describe the bug
A panic occurs when no arguments are passed to JSON.parse.

To Reproduce

JSON.parse()

Expected behavior
Expected: a JavaScript error is raised (Chrome seems to raise a SyntaxError)
image

Build environment (please complete the following information):

  • OS: Windows 10
  • Version: V1909, Build 18363.1082
  • Target triple: x86_64-pc-windows-msvc (also happens with the WASM example on the website)
  • Rustc version: rustc 1.46.0 (04488afe3 2020-08-24)

Additional context
It's caused by an .expect in the builtins/json/mod.rs file.

More info on JSON.parse: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse

@dapper-gh dapper-gh added the bug Something isn't working label Oct 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant