Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(939)

Unified Diff: pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/errors.dart

Issue 2875063003: Fix bugs supporting configuring DDC runtime settings before the application starts. (Closed)
Patch Set: Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/errors.dart
diff --git a/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/errors.dart b/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/errors.dart
index 03ff5a095a84a77496973b7f0dbbfec613d6a86c..0cc9156901d002ddda6b3737588325a3e414875c 100644
--- a/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/errors.dart
+++ b/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/errors.dart
@@ -3,17 +3,21 @@
// BSD-style license that can be found in the LICENSE file.
part of dart._runtime;
-bool _trapRuntimeErrors = true;
-bool _ignoreWhitelistedErrors = true;
-bool _failForWeakModeIsChecks = true;
+// We need to set these properties while the sdk is only partially initialized
+// so we cannot use regular Dart fields.
+bool get _trapRuntimeErrors => JS('bool', 'dart.__trapRuntimeErrors');
vsm 2017/05/11 21:45:56 Can you add a comment as to where these are now ac
+bool get _ignoreWhitelistedErrors =>
+ JS('bool', 'dart.__ignoreWhitelistedErrors');
+bool get _failForWeakModeIsChecks =>
+ JS('bool', 'dart.__failForWeakModeIsChecks');
// Override, e.g., for testing
void trapRuntimeErrors(bool flag) {
- _trapRuntimeErrors = flag;
+ JS('', 'dart.__trapRuntimeErrors = #', flag);
}
void ignoreWhitelistedErrors(bool flag) {
- _ignoreWhitelistedErrors = flag;
+ JS('', 'dart.__ignoreWhitelistedErrors = #', flag);
}
/// Throw an exception on `is` checks that would return an unsound answer in
@@ -32,7 +36,7 @@ void ignoreWhitelistedErrors(bool flag) {
/// well as generic types when the type parameter was inferred. Setting this
/// flag to `true` will not catch these differences in behavior..)
void failForWeakModeIsChecks(bool flag) {
- _failForWeakModeIsChecks = flag;
+ JS('', 'dart.__failForWeakModeIsChecks = #', flag);
}
throwCastError(object, actual, type) => JS(
« no previous file with comments | « pkg/dev_compiler/lib/sdk/ddc_sdk.sum ('k') | pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/profile.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698