Skip to content
This repository was archived by the owner on Sep 16, 2022. It is now read-only.

Commit 1293a6f

Browse files
Googleralorenzen
Googler
authored andcommitted
Use platform_env instead of dart_env in angular tests.
The VM is about to switch to use the CFE's constant evaluator. This change will break const.fromEnvironment on modular builds (which affects blaze and build_runner). Because the only purpose of these definitions was to pass arguments to tests, we can replace them with a runtime Platform.environment variable. Context: b/129881700 and dart-lang/sdk#36513 PiperOrigin-RevId: 242916194
1 parent a166d6b commit 1293a6f

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

_goldens/test/check_goldens_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ void main() {
1717
if (_isBazel) {
1818
path = p.join(
1919
p.current,
20-
const String.fromEnvironment('BAZEL_ROOT_PATH'),
20+
Platform.environment['BAZEL_ROOT_PATH'],
2121
);
2222
if (path == null) {
2323
// Bazel specific: Use an environment variable to define the root path.

_tests/lib/compiler.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ final Future<PackageAssetReader> _packageAssets = (() async {
2929
if (runfiles == null) {
3030
return PackageAssetReader.currentIsolate();
3131
}
32-
final root = const String.fromEnvironment('PKG_ANGULAR_ROOT');
32+
final root = Platform.environment['PKG_ANGULAR_ROOT'];
3333
final path = '$runfiles/$root';
3434
if (!FileSystemEntity.isFileSync('$path/lib/angular.dart')) {
3535
throw StateError('Could not find $path/lib/angular.dart');

0 commit comments

Comments
 (0)