This repository was archived by the owner on Aug 24, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 239
Expand file tree
/
Copy pathSystem.Runtime.CompilerServices.AsyncVoidMethodBuilder.js
More file actions
96 lines (79 loc) · 3.98 KB
/
System.Runtime.CompilerServices.AsyncVoidMethodBuilder.js
File metadata and controls
96 lines (79 loc) · 3.98 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
JSIL.ImplementExternals("System.Runtime.CompilerServices.AsyncVoidMethodBuilder", function ($) {
$.Method({ Static: false, Public: false }, ".ctor",
(new JSIL.MethodSignature(null, [], [])),
function _ctor() {
}
);
$.Method({ Static: true, Public: true }, "Create",
(new JSIL.MethodSignature($jsilcore.TypeRef("System.Runtime.CompilerServices.AsyncVoidMethodBuilder"), [], [])),
function Create() {
return new $jsilcore.System.Runtime.CompilerServices.AsyncVoidMethodBuilder();
}
);
$.Method({ Static: false, Public: true }, "AwaitOnCompleted",
new JSIL.MethodSignature(null, [$jsilcore.TypeRef("JSIL.Reference", ["!!0"]), $jsilcore.TypeRef("JSIL.Reference", ["!!1"])], ["TAwaiter", "TStateMachine"]),
function AwaitOnCompleted(TAwaiter, TStateMachine, awaiter, stateMachine) {
stateMachine = stateMachine.get();
var completedInterfaceMethod = $jsilcore.System.Runtime.CompilerServices.INotifyCompletion.$Methods.OnCompleted.InterfaceMethod;
completedInterfaceMethod.Call(awaiter.get(), null, $jsilcore.System.Action.New(stateMachine, stateMachine.MoveNext));
}
);
$.Method({ Static: false, Public: true }, "AwaitUnsafeOnCompleted",
new JSIL.MethodSignature(null, [$jsilcore.TypeRef("JSIL.Reference", ["!!0"]), $jsilcore.TypeRef("JSIL.Reference", ["!!1"])], ["TAwaiter", "TStateMachine"]),
function AwaitOnCompleted(TAwaiter, TStateMachine, awaiter, stateMachine) {
stateMachine = stateMachine.get();
var completedInterfaceMethod = $jsilcore.System.Runtime.CompilerServices.INotifyCompletion.$Methods.OnCompleted.InterfaceMethod;
completedInterfaceMethod.Call(awaiter.get(), null, $jsilcore.System.Action.New(stateMachine, stateMachine.MoveNext));
}
);
$.Method({ Static: false, Public: true }, "Start",
new JSIL.MethodSignature(null, [$jsilcore.TypeRef("JSIL.Reference", ["!!0"])], ["TStateMachine"]),
function AwaitOnCompleted(TStateMachine, stateMachine) {
stateMachine.get().MoveNext();
}
);
$.Method({ Static: false, Public: true }, "SetResult",
new JSIL.MethodSignature(null, [], []),
function SetResult() {
}
);
$.Method({ Static: false, Public: true }, "SetException",
new JSIL.MethodSignature(null, [$jsilcore.TypeRef("System.Exception")], []),
function SetException(exception) {
JSIL.Host.warning(exception);
}
);
});
JSIL.MakeType({
BaseType: $jsilcore.TypeRef("System.ValueType"),
Name: "System.Runtime.CompilerServices.AsyncVoidMethodBuilder",
IsPublic: true,
IsReferenceType: false,
MaximumConstructorArguments: 1,
}, function ($interfaceBuilder) {
var $ = $interfaceBuilder;
$.ExternalMethod({ Static: false, Public: false }, ".ctor",
new JSIL.MethodSignature(null, [$jsilcore.TypeRef("System.Threading.SynchronizationContext")], [])
);
$.ExternalMethod({ Static: false, Public: true }, "AwaitOnCompleted",
new JSIL.MethodSignature(null, [$jsilcore.TypeRef("JSIL.Reference", ["!!0"]), $jsilcore.TypeRef("JSIL.Reference", ["!!1"])], ["TAwaiter", "TStateMachine"])
);
$.ExternalMethod({ Static: false, Public: true }, "AwaitUnsafeOnCompleted",
new JSIL.MethodSignature(null, [$jsilcore.TypeRef("JSIL.Reference", ["!!0"]), $jsilcore.TypeRef("JSIL.Reference", ["!!1"])], ["TAwaiter", "TStateMachine"])
);
$.ExternalMethod({ Static: true, Public: true }, "Create",
new JSIL.MethodSignature($.Type, [], [])
);
$.ExternalMethod({ Static: false, Public: true }, "SetException",
new JSIL.MethodSignature(null, [$jsilcore.TypeRef("System.Exception")], [])
);
$.ExternalMethod({ Static: false, Public: true }, "SetResult",
new JSIL.MethodSignature(null, [], [])
);
$.ExternalMethod({ Static: false, Public: true }, "SetStateMachine",
new JSIL.MethodSignature(null, [$jsilcore.TypeRef("System.Runtime.CompilerServices.IAsyncStateMachine")], [])
);
$.ExternalMethod({ Static: false, Public: true }, "Start",
new JSIL.MethodSignature(null, [$jsilcore.TypeRef("JSIL.Reference", ["!!0"])], ["TStateMachine"])
);
});