Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Update typescript.code-snippets #98521

Merged
merged 1 commit into from
May 27, 2020
Merged

Update typescript.code-snippets #98521

merged 1 commit into from
May 27, 2020

Conversation

Jack-Works
Copy link
Contributor

  1. Change code snippet throw "$1" to throw new Error("$1"). Throw a string is a bad practice because it will drop the execution stack.
  2. Add a new snippet for await of

@kieferrm kieferrm requested a review from mjbvz May 25, 2020 22:44
@mjbvz
Copy link
Collaborator

mjbvz commented May 26, 2020

The for await addition looks good but I don't think we should change the throw. This snippet has bee there for a while so changing it may break people's workflows (for example, if you are using it to rethrow an exception)

@Jack-Works
Copy link
Contributor Author

Hmm how to use it to rethrow exception? It provides a string as default

@mjbvz mjbvz merged commit ece530a into microsoft:master May 27, 2020
@mjbvz
Copy link
Collaborator

mjbvz commented May 27, 2020

Good point. This looks like an improvement then.

Thanks, this will be in the next VS Code insiders build

@mjbvz mjbvz added this to the May 2020 milestone May 27, 2020
@github-actions github-actions bot locked and limited conversation to collaborators Jul 11, 2020
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants