This commit is contained in:
Benjamin Lichtman committed 2018-09-14 17:20:46 -07:00
1 parent 9e1a05c9ec
commit 32cb9ece8b
3 files changed
+30

No files matched your search

@@ -1138,6 +1138,12 @@ const [#|foo|] = function () {
const foo = function [#|f|]() {
return fetch('https://typescriptlang.org').then(result => { console.log(result) });
}
`);
_testConvertToAsyncFunction("convertToAsyncFunction_simpleFunctionExpressionAssignedToBindingPattern", `
const { length } = [#|function|] () {
return fetch('https://typescriptlang.org').then(result => { console.log(result) });
}
`);
_testConvertToAsyncFunction("convertToAsyncFunction_catchBlockUniqueParams", `
@@ -0,0 +1,12 @@
// ==ORIGINAL==
const { length } = /*[#|*/function/*|]*/ () {
return fetch('https://typescriptlang.org').then(result => { console.log(result) });
}
// ==ASYNC FUNCTION::Convert to async function==
const { length } = async function () {
const result = await fetch('https://typescriptlang.org');
console.log(result);
}
@@ -0,0 +1,12 @@
// ==ORIGINAL==
const { length } = /*[#|*/function/*|]*/ () {
return fetch('https://typescriptlang.org').then(result => { console.log(result) });
}
// ==ASYNC FUNCTION::Convert to async function==
const { length } = async function () {
const result = await fetch('https://typescriptlang.org');
console.log(result);
}