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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
|
<!doctype html>
<html lang="en-us">
<head>
</head>
<body>
<script type='text/javascript'>
var App = {
init: function () {
this.int_add = Module.mono_bind_static_method ("[debugger-test] Math:IntAdd");
this.use_complex = Module.mono_bind_static_method ("[debugger-test] Math:UseComplex");
this.delegates_test = Module.mono_bind_static_method ("[debugger-test] Math:DelegatesTest");
this.generic_types_test = Module.mono_bind_static_method ("[debugger-test] Math:GenericTypesTest");
this.outer_method = Module.mono_bind_static_method ("[debugger-test] Math:OuterMethod");
this.async_method = Module.mono_bind_static_method ("[debugger-test] Math/NestedInMath:AsyncTest");
this.method_with_structs = Module.mono_bind_static_method ("[debugger-test] DebuggerTests.ValueTypesTest:MethodWithLocalStructs");
this.static_method_table = {};
console.log ("ready");
},
};
function invoke_static_method (method_name, ...args) {
var method = App.static_method_table [method_name];
if (method == undefined)
method = App.static_method_table [method_name] = Module.mono_bind_static_method (method_name);
return method (...args);
}
async function invoke_static_method_async (method_name, ...args) {
var method = App.static_method_table [method_name];
if (method == undefined) {
method = App.static_method_table [method_name] = Module.mono_bind_static_method (method_name);
}
return await method (...args);
}
function invoke_add () {
return App.int_add (10, 20);
}
function invoke_use_complex () {
return App.use_complex (10, 20);
}
function invoke_delegates_test () {
return App.delegates_test ();
}
function invoke_generic_types_test () {
return App.generic_types_test ();
}
function invoke_bad_js_test () {
console.log ("js: In invoke_bad_js_test");
App.non_existant ();
console.log ("js: After.. shouldn't reach here");
}
function invoke_outer_method () {
console.log('invoke_outer_method called');
return App.outer_method ();
}
async function invoke_async_method_with_await () {
return await App.async_method ("string from js", 42);
}
function invoke_method_with_structs () {
return App.method_with_structs ();
}
</script>
<script type="text/javascript" src="mono-config.js"></script>
<script type="text/javascript" src="runtime.js"></script>
<script async type="text/javascript" src="dotnet.js"></script>
Stuff goes here
</body>
</html>
17 sdks/wasm/debugger-test.cs
@@ -0,0 +1,17 @@
using System;
public class Math { //Only append content to this class as the test suite depends on line info
public static int IntAdd (int a, int b) {
int c = a + b;
int d = c + b;
int e = d + a;
return e;
}
public static int UseComplex () {
var complex = new Simple.Complex (10, "xx");
var res = complex.DoStuff ();
return res;
}
}
19 sdks/wasm/debugger-test2.cs
@@ -0,0 +1,19 @@
using System;
public class Misc { //Only append content to this class as the test suite depends on line info
public static int CreateObject (int foo, int bar) {
var f = new Fancy () {
Foo = foo,
Bar = bar,
};
Console.WriteLine ($"{f.Foo} {f.Bar}");
return f.Foo + f.Bar;
}
}
public class Fancy {
public int Foo;
public int Bar { get ; set; }
}
|