@@ -144,7 +144,7 @@ func makeForInOfLoopGenerator(
144144
145145 // 'await using' requires an async function context, even inside a standard (non-async) for-of loop.
146146 let context : GeneratorStub . ContextRequirement =
147- ( isAsyncIteration || requiresAsyncContext) ? . single( . asyncFunction ) : . single( . javascript)
147+ ( isAsyncIteration || requiresAsyncContext) ? . single( . async ) : . single( . javascript)
148148
149149 let inputs : GeneratorStub . Inputs
150150 switch type {
@@ -819,7 +819,7 @@ public let CodeGenerators: [CodeGenerator] = [
819819 CodeGenerator (
820820 " AsyncDisposableObjVariableGenerator " ,
821821 disposableObjVariableGeneratorStubs (
822- inContext: . asyncFunction ,
822+ inContext: . async ,
823823 withSymbol: " asyncDispose "
824824 ) { b, variable in
825825 b. loadAsyncDisposableVariable ( variable)
@@ -837,7 +837,7 @@ public let CodeGenerators: [CodeGenerator] = [
837837 CodeGenerator (
838838 " AsyncDisposableClassVariableGenerator " ,
839839 disposableClassVariableGeneratorStubs (
840- inContext: . asyncFunction ,
840+ inContext: . async ,
841841 withSymbol: " asyncDispose "
842842 ) { b, variable in
843843 b. loadAsyncDisposableVariable ( variable)
@@ -1769,7 +1769,7 @@ public let CodeGenerators: [CodeGenerator] = [
17691769 " AsyncFunctionGenerator " ,
17701770 [
17711771 GeneratorStub (
1772- " AsyncFunctionBeginGenerator " , provides: [ . javascript, . subroutine, . asyncFunction ]
1772+ " AsyncFunctionBeginGenerator " , provides: [ . javascript, . subroutine, . async ]
17731773 ) { b in
17741774 let ( randomParameters, defaultValues) = b. randomParameters ( )
17751775 . withRandomDefaultParameters (
@@ -1787,7 +1787,7 @@ public let CodeGenerators: [CodeGenerator] = [
17871787 } ,
17881788 GeneratorStub (
17891789 " AsyncFunctionEndGenerator " ,
1790- inContext: . single( [ . javascript, . subroutine, . asyncFunction ] )
1790+ inContext: . single( [ . javascript, . subroutine, . async ] )
17911791 ) { b in
17921792 b. await ( b. randomJsVariable ( ) )
17931793 b. doReturn ( b. randomJsVariable ( ) )
@@ -1803,7 +1803,7 @@ public let CodeGenerators: [CodeGenerator] = [
18031803 [
18041804 GeneratorStub (
18051805 " AsyncArrowFunctionBeginGenerator " ,
1806- provides: [ . javascript, . asyncFunction ]
1806+ provides: [ . javascript, . async ]
18071807 ) { b in
18081808 let ( randomParameters, defaultValues) = b. randomParameters ( )
18091809 . withRandomDefaultParameters (
@@ -1820,14 +1820,14 @@ public let CodeGenerators: [CodeGenerator] = [
18201820 } ,
18211821 GeneratorStub (
18221822 " AsyncArrowFunctionAwaitGenerator " ,
1823- inContext: . single( [ . javascript, . asyncFunction ] ) ,
1824- provides: [ . javascript, . asyncFunction ]
1823+ inContext: . single( [ . javascript, . async ] ) ,
1824+ provides: [ . javascript, . async ]
18251825 ) { b in
18261826 b. await ( b. randomJsVariable ( ) )
18271827 } ,
18281828 GeneratorStub (
18291829 " AsyncArrowFunctionEndGenerator " ,
1830- inContext: . single( [ . javascript, . asyncFunction ] )
1830+ inContext: . single( [ . javascript, . async ] )
18311831 ) { b in
18321832 // These are "typically" used as arguments, so we don't directly generate a call operation here.
18331833 b. doReturn ( b. randomJsVariable ( ) )
@@ -1842,7 +1842,7 @@ public let CodeGenerators: [CodeGenerator] = [
18421842 [
18431843 GeneratorStub (
18441844 " AsyncGeneratorFunctionBeginGenerator " ,
1845- provides: [ . javascript, . subroutine, . asyncFunction , . generatorFunction]
1845+ provides: [ . javascript, . subroutine, . async , . generatorFunction]
18461846 ) { b in
18471847 let ( randomParameters, defaultValues) = b. randomParameters ( )
18481848 . withRandomDefaultParameters (
@@ -1861,7 +1861,7 @@ public let CodeGenerators: [CodeGenerator] = [
18611861 } ,
18621862 GeneratorStub (
18631863 " AsyncGeneratorFunctionEndGenerator " ,
1864- inContext: . single( [ . javascript, . subroutine, . generatorFunction, . asyncFunction ] )
1864+ inContext: . single( [ . javascript, . subroutine, . generatorFunction, . async ] )
18651865 ) { b in
18661866 b. await ( b. randomJsVariable ( ) )
18671867 if probability ( 0.5 ) {
@@ -2373,7 +2373,7 @@ public let CodeGenerators: [CodeGenerator] = [
23732373 b. yieldEach ( val)
23742374 } ,
23752375
2376- CodeGenerator ( " AwaitGenerator " , inContext: . single( . asyncFunction ) , inputs: . one ) {
2376+ CodeGenerator ( " AwaitGenerator " , inContext: . single( . async ) , inputs: . preferred ( . jsPromise ) ) {
23772377 b, val in
23782378 b. await ( val)
23792379 } ,
0 commit comments