| 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 /* This file defines the module loader for the dart runtime. | 5 /* This file defines the module loader for the dart runtime. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 var dart_library = | 8 var dart_library = |
| 9 typeof module != "undefined" && module.exports || {}; | 9 typeof module != "undefined" && module.exports || {}; |
| 10 | 10 |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 window.MemoryInfo = window.performance.memory.constructor; | 132 window.MemoryInfo = window.performance.memory.constructor; |
| 133 } | 133 } |
| 134 if (typeof Geolocation == "undefined") { | 134 if (typeof Geolocation == "undefined") { |
| 135 navigator.geolocation.constructor; | 135 navigator.geolocation.constructor; |
| 136 } | 136 } |
| 137 if (typeof Animation == "undefined") { | 137 if (typeof Animation == "undefined") { |
| 138 let d = document.createElement('div'); | 138 let d = document.createElement('div'); |
| 139 window.Animation = d.animate(d).constructor; | 139 window.Animation = d.animate(d).constructor; |
| 140 } | 140 } |
| 141 if (typeof WebGLVertexArrayObjectOES == "undefined") { | 141 if (typeof WebGLVertexArrayObjectOES == "undefined") { |
| 142 window.WebGLVertexArrayObjectOES = document.createElement('canvas') | 142 let context = document.createElement('canvas').getContext('webgl'); |
| 143 .getContext('webgl') | 143 if (context) { |
| 144 .getExtension("OES_vertex_array_object") | 144 window.WebGLVertexArrayObjectOES = |
| 145 .createVertexArrayOES().constructor; | 145 context.getExtension("OES_vertex_array_object") |
| 146 .createVertexArrayOES().constructor; |
| 147 } |
| 146 } | 148 } |
| 147 } | 149 } |
| 148 | 150 |
| 149 // This import is only needed for chrome debugging. We should provide an | 151 // This import is only needed for chrome debugging. We should provide an |
| 150 // option to compile without it. | 152 // option to compile without it. |
| 151 dart_sdk._debugger.registerDevtoolsFormatter(); | 153 dart_sdk._debugger.registerDevtoolsFormatter(); |
| 152 } | 154 } |
| 153 | 155 |
| 154 })(dart_library); | 156 })(dart_library); |
| OLD | NEW |