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

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

Issue 2874813002: Support configuring DDC runtime settings before the application starts and normalize API for config… (Closed)
Patch Set: Support configuring DDC runtime settings before the application starts and normalize API for config… 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
« no previous file with comments | « pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/profile.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 0cd99deb25ede32deddefeeab3f04b0104a96b8e..54b54c38380334479f9c67354332bb5049b8c7b0 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
@@ -89,9 +89,29 @@ final global_ = JS(
window.SourceBufferList = new MediaSource().sourceBuffers.constructor;
}
}
+
var globalState = (typeof window != "undefined") ? window
: (typeof global != "undefined") ? global
: (typeof self != "undefined") ? self : {};
+
+ // 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);
+ }
+ }
+
return globalState;
}()
''');
« no previous file with comments | « pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/profile.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698