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

Unified Diff: pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/runtime.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/runtime.dart
diff --git a/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/runtime.dart b/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/runtime.dart
index 54b54c38380334479f9c67354332bb5049b8c7b0..ee6e27987222b401e8d4de374257088fcb588186 100644
--- a/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/runtime.dart
+++ b/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/runtime.dart
@@ -96,21 +96,17 @@ final global_ = JS(
// These settings must be configured before the application starts so that
// user code runs with the correct configuration.
- if ('ddcSettings' in globalState) {
- let settings = globalState.ddcSettings;
- if ('trapRuntimeErrors' in settings) {
- $trapRuntimeErrors(settings.trapRuntimeErrors);
- }
- if ('ignoreWhitelistedErrors' in settings) {
- $ignoreWhitelistedErrors(settings.ignoreWhitelistedErrors);
- }
- if ('failForWeakModeIsChecks' in settings) {
- $failForWeakModeIsChecks(settings.failForWeakModeIsChecks);
- }
- if ('trackProfile' in settings) {
- $trackProfile(settings.trackProfile);
- }
- }
+ let settings = 'ddcSettings' in globalState ? globalState.ddcSettings : {};
+ $trapRuntimeErrors(
+ 'trapRuntimeErrors' in settings ? settings.trapRuntimeErrors : true);
+ $ignoreWhitelistedErrors(
+ 'ignoreWhitelistedErrors' in settings ?
+ settings.ignoreWhitelistedErrors : true);
+ $failForWeakModeIsChecks(
+ 'failForWeakModeIsChecks' in settings ?
+ settings.failForWeakModeIsChecks : true);
+ $trackProfile(
+ 'trackProfile' in settings ? settings.trackProfile : false);
return globalState;
}()

Powered by Google App Engine
This is Rietveld 408576698