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

Fix: Playground errors when serializing logs #3168

Open
wants to merge 1 commit into
base: v2
Choose a base branch
from

Conversation

lukaw3d
Copy link
Contributor

@lukaw3d lukaw3d commented Jun 28, 2024

Related to #3169

Errors thrown in Playground's output serialization should be different than user code errors.

Before:
https://www.typescriptlang.org/play/?target=7#code/PTAEAEBcEMCcHMCmkBcoCiBlATABjwFADGA9gHYDOJANogHTUnwAUA3qNGgIw+9-8DBQ4ULKgAvgEoCQA

  • // @target: ES2020
    console.log({ a: 11111111111111111111111111111111111111111111111111111n })
  • Click "Run"

  • [ERR]: "Executed JavaScript Failed:"
    [ERR]: Do not know how to serialize a BigInt

    thrown by

    JSON.stringify(arg, (_, value) => (value === undefined ? "__undefined__" : value), 2).replace(

After:

  • [LOG]: Failed to serialize log

For comparison, user code error:

  • // @target: ES2020
    JSON.stringify({ a: 11111111111111111111111111111111111111111111111111111n })
  • [ERR]: "Executed JavaScript Failed:"
    [ERR]: Do not know how to serialize a BigInt

@lukaw3d
Copy link
Contributor Author

lukaw3d commented Jun 28, 2024

@microsoft-github-policy-service agree

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant