@@ -54,11 +54,12 @@ const testCases = [
5454 '(async () => { return (console.log(`${(await { a: 1 }).a}`)) })()' ] ,
5555 /* eslint-enable no-template-curly-in-string */
5656 [ 'await 0; function foo() {}' ,
57- 'var foo; (async () => { await 0; foo= function foo() {} })()' ] ,
57+ 'var foo; (async () => { await 0; this. foo = foo; function foo() {} })()' ] ,
5858 [ 'await 0; class Foo {}' ,
5959 'let Foo; (async () => { await 0; Foo=class Foo {} })()' ] ,
6060 [ 'if (await true) { function foo() {} }' ,
61- 'var foo; (async () => { if (await true) { foo=function foo() {} } })()' ] ,
61+ 'var foo; (async () => { ' +
62+ 'if (await true) { this.foo = foo; function foo() {} } })()' ] ,
6263 [ 'if (await true) { class Foo{} }' ,
6364 '(async () => { if (await true) { class Foo{} } })()' ] ,
6465 [ 'if (await true) { var a = 1; }' ,
@@ -116,6 +117,9 @@ const testCases = [
116117 '(async () => { for (let i in {x:1}) { await 1 } })()' ] ,
117118 [ 'for (const i in {x:1}) { await 1 }' ,
118119 '(async () => { for (const i in {x:1}) { await 1 } })()' ] ,
120+ [ 'var x = await foo(); async function foo() { return Promise.resolve(1);}' ,
121+ 'var x; var foo; (async () => { void (x = await foo()); this.foo = foo; ' +
122+ 'async function foo() { return Promise.resolve(1);} })()' ] ,
119123] ;
120124
121125for ( const [ input , expected ] of testCases ) {
0 commit comments