mirror of
https://github.com/dart-lang/sdk
synced 2024-11-02 12:24:24 +00:00
61b2ec77e1
When (user) assertions are enabled in dart2js, we automatically update the environment as if -Ddart.web.assertions_enabled=true were passed. This allows dev-only code to be gated behind `const bool.fromEnvironment('dart.web.assertions_enabled')` without having to supply a redundant option manually. Change-Id: I40d670b6fe87d5e27b2b8d50599261cca8a79a42 Bug: b/254543452 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/270301 Reviewed-by: Sigmund Cherem <sigmund@google.com>
11 lines
383 B
Dart
11 lines
383 B
Dart
// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file
|
|
// for details. All rights reserved. Use of this source code is governed by a
|
|
// BSD-style license that can be found in the LICENSE file.
|
|
|
|
// dart2jsOptions=--enable-asserts
|
|
|
|
import "package:expect/expect.dart";
|
|
|
|
void main() {
|
|
Expect.isTrue(const bool.fromEnvironment('dart.web.assertions_enabled'));
|
|
}
|