Chromium Code Reviews| 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 | |
| 93 // These settings must be configured before the application starts so that | |
|
vsm
2017/05/10 16:42:05
Might be worth moving the globalState decl above t
Jacob
2017/05/10 17:05:26
Good point. Done.
| |
| 94 // user code runs with the correct configuration. | |
| 95 if ('ddcSettings' in window) { | |
| 96 let settings = window.ddcSettings; | |
| 97 if ('trapRuntimeErrors' in settings) { | |
| 98 $trapRuntimeErrors(settings.trapRuntimeErrors); | |
| 99 } | |
| 100 if ('ignoreWhitelistedErrors' in settings) { | |
| 101 $ignoreWhitelistedErrors(settings.ignoreWhitelistedErrors); | |
| 102 } | |
| 103 if ('failForWeakModeIsChecks' in settings) { | |
| 104 $failForWeakModeIsChecks(settings.failForWeakModeIsChecks); | |
| 105 } | |
| 106 if ('trackProfile' in settings) { | |
| 107 $trackProfile(settings.trackProfile); | |
| 108 } | |
| 109 } | |
| 110 | |
| 92 var globalState = (typeof window != "undefined") ? window | 111 var globalState = (typeof window != "undefined") ? window |
| 93 : (typeof global != "undefined") ? global | 112 : (typeof global != "undefined") ? global |
| 94 : (typeof self != "undefined") ? self : {}; | 113 : (typeof self != "undefined") ? self : {}; |
| 95 return globalState; | 114 return globalState; |
| 96 }() | 115 }() |
| 97 '''); | 116 '''); |
| 98 | 117 |
| 99 final JsSymbol = JS('', 'Symbol'); | 118 final JsSymbol = JS('', 'Symbol'); |
| OLD | NEW |