diff --git a/benchmark/lib/report.dart b/benchmark/lib/report.dart index 38c9169..bd6ecf2 100644 --- a/benchmark/lib/report.dart +++ b/benchmark/lib/report.dart @@ -32,18 +32,22 @@ pb.Response findUpdatedResponse(pb.Report beforeRep, pb.Report afterRep) { pb.Platform createPlatform() { return new pb.Platform() ..dartVM = _isDartVM - ..checkedMode = _checkedMode; + ..checkedMode = _implicitChecksEnabled; } get _isDartVM => !identical(1, 1.0); -final bool _checkedMode = () { - var checked = false; - assert(() { - checked = true; +/// Returns `false` if running via dart2js and `--omit-implicit-checks` is set +final bool _implicitChecksEnabled = () { + // ignore: unused_local_variable + bool x = true; + try { + // Trigger an exception if we're in checked mode. + x = "" as dynamic; + return false; + } catch (e) { return true; - }()); - return checked; + } }(); /// Given the contents of the pubspec.yaml and pubspec.lock files, diff --git a/build.yaml b/build.yaml index b26ad9f..5f82db1 100644 --- a/build.yaml +++ b/build.yaml @@ -6,3 +6,8 @@ targets: build_web_compilers|entrypoint: generate_for: - benchmark/*_browser.dart + options: + dart2js_args: + - --minify + #- --trust-primitives + #- --omit-implicit-checks