Skip to content

Commit ba59302

Browse files
authored
Drop JSDisconnectedException trap from WASM samples (#397)
1 parent 8b1e9f3 commit ba59302

File tree

16 files changed

+21
-147
lines changed

16 files changed

+21
-147
lines changed

5.0/BlazorSample_WebAssembly/Pages/call-js-from-dotnet/CallJsExample6.razor

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,7 @@
3939
{
4040
if (module is not null)
4141
{
42-
try
43-
{
44-
await module.DisposeAsync();
45-
}
46-
catch (JSDisconnectedException)
47-
{
48-
}
42+
await module.DisposeAsync();
4943
}
5044
}
5145
}

5.0/BlazorSample_WebAssembly/Pages/call-js-from-dotnet/CallJsExample8.razor

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -34,24 +34,12 @@
3434
{
3535
if (mapInstance is not null)
3636
{
37-
try
38-
{
39-
await mapInstance.DisposeAsync();
40-
}
41-
catch (JSDisconnectedException)
42-
{
43-
}
37+
await mapInstance.DisposeAsync();
4438
}
4539

4640
if (mapModule is not null)
4741
{
48-
try
49-
{
50-
await mapModule.DisposeAsync();
51-
}
52-
catch (JSDisconnectedException)
53-
{
54-
}
42+
await mapModule.DisposeAsync();
5543
}
5644
}
5745
}

6.0/BlazorSample_WebAssembly/Pages/call-js-from-dotnet/CallJsExample6.razor

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,7 @@
3838
{
3939
if (module is not null)
4040
{
41-
try
42-
{
43-
await module.DisposeAsync();
44-
}
45-
catch (JSDisconnectedException)
46-
{
47-
}
41+
await module.DisposeAsync();
4842
}
4943
}
5044
}

6.0/BlazorSample_WebAssembly/Pages/call-js-from-dotnet/CallJsExample8.razor

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -39,24 +39,12 @@
3939
{
4040
if (mapInstance is not null)
4141
{
42-
try
43-
{
44-
await mapInstance.DisposeAsync();
45-
}
46-
catch (JSDisconnectedException)
47-
{
48-
}
42+
await mapInstance.DisposeAsync();
4943
}
5044

5145
if (mapModule is not null)
5246
{
53-
try
54-
{
55-
await mapModule.DisposeAsync();
56-
}
57-
catch (JSDisconnectedException)
58-
{
59-
}
47+
await mapModule.DisposeAsync();
6048
}
6149
}
6250
}

7.0/BlazorSample_WebAssembly/Pages/call-js-from-dotnet/CallJsExample6.razor

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,7 @@
3838
{
3939
if (module is not null)
4040
{
41-
try
42-
{
43-
await module.DisposeAsync();
44-
}
45-
catch (JSDisconnectedException)
46-
{
47-
}
41+
await module.DisposeAsync();
4842
}
4943
}
5044
}

7.0/BlazorSample_WebAssembly/Pages/call-js-from-dotnet/CallJsExample8.razor

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -39,24 +39,12 @@
3939
{
4040
if (mapInstance is not null)
4141
{
42-
try
43-
{
44-
await mapInstance.DisposeAsync();
45-
}
46-
catch (JSDisconnectedException)
47-
{
48-
}
42+
await mapInstance.DisposeAsync();
4943
}
5044

5145
if (mapModule is not null)
5246
{
53-
try
54-
{
55-
await mapModule.DisposeAsync();
56-
}
57-
catch (JSDisconnectedException)
58-
{
59-
}
47+
await mapModule.DisposeAsync();
6048
}
6149
}
6250
}

8.0/BlazorSample_WebAssembly/Pages/CallDotnet1.razor

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,7 @@
3636
{
3737
if (module is not null)
3838
{
39-
try
40-
{
41-
await module.DisposeAsync();
42-
}
43-
catch (JSDisconnectedException)
44-
{
45-
}
39+
await module.DisposeAsync();
4640
}
4741
}
4842
}

8.0/BlazorSample_WebAssembly/Pages/CallDotnet8.razor

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,7 @@
4040
{
4141
if (module is not null)
4242
{
43-
try
44-
{
45-
await module.DisposeAsync();
46-
}
47-
catch (JSDisconnectedException)
48-
{
49-
}
43+
await module.DisposeAsync();
5044
}
5145
}
5246
}

8.0/BlazorSample_WebAssembly/Pages/CallJs6.razor

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,7 @@
3737
{
3838
if (module is not null)
3939
{
40-
try
41-
{
42-
await module.DisposeAsync();
43-
}
44-
catch (JSDisconnectedException)
45-
{
46-
}
40+
await module.DisposeAsync();
4741
}
4842
}
4943
}

8.0/BlazorSample_WebAssembly/Pages/CallJs8.razor

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -46,24 +46,12 @@
4646
{
4747
if (mapInstance is not null)
4848
{
49-
try
50-
{
51-
await mapInstance.DisposeAsync();
52-
}
53-
catch (JSDisconnectedException)
54-
{
55-
}
49+
await mapInstance.DisposeAsync();
5650
}
5751

5852
if (mapModule is not null)
5953
{
60-
try
61-
{
62-
await mapModule.DisposeAsync();
63-
}
64-
catch (JSDisconnectedException)
65-
{
66-
}
54+
await mapModule.DisposeAsync();
6755
}
6856
}
6957
}

0 commit comments

Comments
 (0)