Update typescript.code-snippets by Jack-Works · Pull Request #98521 · microsoft/vscode
Navigation Menu
{{ message }}
- Notifications You must be signed in to change notification settings
- Fork 38.9k
Merged
Update typescript.code-snippets#98521
mjbvz merged 1 commit intomicrosoft:masterfrom
Jack-Works:patch-1
Update typescript.code-snippets#98521
mjbvz merged 1 commit intomicrosoft:masterfrom
Jack-Works:patch-1
Conversation
Copy link Copy Markdown
Contributor
Jack-Works
commented
May 25, 2020
Jack-Works
commented
- Change code snippet
throw "$1"tothrow new Error("$1"). Throw a string is a bad practice because it will drop the execution stack. - Add a new snippet
for await of
kieferrm
requested a review
from mjbvz
Copy link Copy Markdown
Collaborator
mjbvz
commented
May 26, 2020
mjbvz commented
May 26, 2020The 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)
Copy link Copy Markdown
Contributor Author
Jack-Works
commented
May 26, 2020
Jack-Works commented
May 26, 2020Hmm how to use it to rethrow exception? It provides a string as default
mjbvz
merged commit
ece530a
into
microsoft:master
Copy link Copy Markdown
Collaborator
mjbvz
commented
May 27, 2020
mjbvz commented
May 27, 2020Good point. This looks like an improvement then.
Thanks, this will be in the next VS Code insiders build
mjbvz
added this to the
May 2020 milestone
github-actions
bot
locked and limited conversation to collaborators
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.