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; |
}() |
'''); |