Update typescript.code-snippets by Jack-Works · Pull Request #98521 · microsoft/vscode

Skip to content

Navigation Menu

Sign in

Appearance settings

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Appearance settings

Merged

mjbvz merged 1 commit intomicrosoft:masterfrom

Jack-Works:patch-1

May 27, 2020

Merged

Update typescript.code-snippets#98521

mjbvz merged 1 commit intomicrosoft:masterfrom

Jack-Works:patch-1

Conversation

@Jack-Works

Copy link Copy Markdown

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 Copy Markdown

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 Copy Markdown

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 Copy Markdown

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

@mjbvz mjbvz Awaiting requested review from mjbvz

Assignees

@mjbvz mjbvz

Labels

None yet

Projects

None yet

Milestone

May 2020

Development

Successfully merging this pull request may close these issues.

2 participants

@Jack-Works @mjbvz