OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 library dart._runtime; | 5 library dart._runtime; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 import 'dart:collection'; | 8 import 'dart:collection'; |
9 | 9 |
10 import 'dart:_debugger' show stackTraceMapper; | 10 import 'dart:_debugger' show stackTraceMapper; |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 if (typeof Animation == "undefined") { | 82 if (typeof Animation == "undefined") { |
83 let d = document.createElement('div'); | 83 let d = document.createElement('div'); |
84 if (typeof d.animate != "undefined") { | 84 if (typeof d.animate != "undefined") { |
85 window.Animation = d.animate(d).constructor; | 85 window.Animation = d.animate(d).constructor; |
86 } | 86 } |
87 } | 87 } |
88 if (typeof SourceBufferList == "undefined") { | 88 if (typeof SourceBufferList == "undefined") { |
89 window.SourceBufferList = new MediaSource().sourceBuffers.constructor; | 89 window.SourceBufferList = new MediaSource().sourceBuffers.constructor; |
90 } | 90 } |
91 } | 91 } |
| 92 |
92 var globalState = (typeof window != "undefined") ? window | 93 var globalState = (typeof window != "undefined") ? window |
93 : (typeof global != "undefined") ? global | 94 : (typeof global != "undefined") ? global |
94 : (typeof self != "undefined") ? self : {}; | 95 : (typeof self != "undefined") ? self : {}; |
| 96 |
| 97 // These settings must be configured before the application starts so that |
| 98 // user code runs with the correct configuration. |
| 99 if ('ddcSettings' in globalState) { |
| 100 let settings = globalState.ddcSettings; |
| 101 if ('trapRuntimeErrors' in settings) { |
| 102 $trapRuntimeErrors(settings.trapRuntimeErrors); |
| 103 } |
| 104 if ('ignoreWhitelistedErrors' in settings) { |
| 105 $ignoreWhitelistedErrors(settings.ignoreWhitelistedErrors); |
| 106 } |
| 107 if ('failForWeakModeIsChecks' in settings) { |
| 108 $failForWeakModeIsChecks(settings.failForWeakModeIsChecks); |
| 109 } |
| 110 if ('trackProfile' in settings) { |
| 111 $trackProfile(settings.trackProfile); |
| 112 } |
| 113 } |
| 114 |
95 return globalState; | 115 return globalState; |
96 }() | 116 }() |
97 '''); | 117 '''); |
98 | 118 |
99 final JsSymbol = JS('', 'Symbol'); | 119 final JsSymbol = JS('', 'Symbol'); |
OLD | NEW |