File tree Expand file tree Collapse file tree 2 files changed +18
-3
lines changed Expand file tree Collapse file tree 2 files changed +18
-3
lines changed Original file line number Diff line number Diff line change 1
1
# Changelog
2
2
3
+ ## Unreleased
4
+
5
+ ### Fixes
6
+
7
+ - isWeb check for WASM ([ #1249 ] ( https://github.com/getsentry/sentry-dart/pull/1249 ) )
8
+
3
9
## 7.0.0-alpha.5
4
10
5
11
### Features
Original file line number Diff line number Diff line change @@ -3,10 +3,12 @@ import 'platform/platform.dart';
3
3
/// Helper to check in which enviroment the library is running.
4
4
/// The envirment checks (release/debug/profile) are mutually exclusive.
5
5
class PlatformChecker {
6
- const PlatformChecker ({
6
+ static const _jsUtil = 'dart.library.js_util' ;
7
+
8
+ PlatformChecker ({
7
9
this .platform = instance,
8
- this .isWeb = identical ( 0 , 0.0 ) ,
9
- });
10
+ bool ? isWeb ,
11
+ }) : isWeb = isWeb ?? _isWebWithWasmSupport () ;
10
12
11
13
/// Check if running in release/production environment
12
14
bool isReleaseMode () {
@@ -48,5 +50,12 @@ class PlatformChecker {
48
50
return false ;
49
51
}
50
52
53
+ static bool _isWebWithWasmSupport () {
54
+ if (const bool .hasEnvironment (_jsUtil)) {
55
+ return const bool .fromEnvironment (_jsUtil);
56
+ }
57
+ return identical (0 , 0.0 );
58
+ }
59
+
51
60
final Platform platform;
52
61
}
You can’t perform that action at this time.
0 commit comments