Index: pkg/dev_compiler/lib/js/common/dart_sdk.js |
diff --git a/pkg/dev_compiler/lib/js/common/dart_sdk.js b/pkg/dev_compiler/lib/js/common/dart_sdk.js |
index ac83d92049f52dee073bac6d86fba217ee93e461..65cfeff74eb5ca48bd794b316fc8a8cc209c6d2d 100644 |
--- a/pkg/dev_compiler/lib/js/common/dart_sdk.js |
+++ b/pkg/dev_compiler/lib/js/common/dart_sdk.js |
@@ -2330,7 +2330,56 @@ |
dart.copyProperties = function(to, from) { |
return dart.copyTheseProperties(to, from, dart.getOwnNamesAndSymbols(from)); |
}; |
- dart.global = typeof window == "undefined" ? global : window; |
+ dart.global = (function() { |
+ if (typeof NodeList !== "undefined") { |
+ NodeList.prototype.get = function(i) { |
+ return this[i]; |
+ }; |
+ NamedNodeMap.prototype.get = function(i) { |
+ return this[i]; |
+ }; |
+ DOMTokenList.prototype.get = function(i) { |
+ return this[i]; |
+ }; |
+ HTMLCollection.prototype.get = function(i) { |
+ return this[i]; |
+ }; |
+ if (typeof PannerNode == "undefined") { |
+ let audioContext; |
+ if (typeof AudioContext == "undefined" && typeof webkitAudioContext != "undefined") { |
+ audioContext = new webkitAudioContext(); |
+ } else { |
+ audioContext = new AudioContext(); |
+ window.StereoPannerNode = audioContext.createStereoPanner().constructor; |
+ } |
+ window.PannerNode = audioContext.createPanner().constructor; |
+ } |
+ if (typeof AudioSourceNode == "undefined") { |
+ window.AudioSourceNode = MediaElementAudioSourceNode.__proto__; |
+ } |
+ if (typeof FontFaceSet == "undefined") { |
+ window.FontFaceSet = document.fonts.__proto__.constructor; |
+ } |
+ if (typeof MemoryInfo == "undefined") { |
+ if (typeof window.performance.memory != "undefined") { |
+ window.MemoryInfo = window.performance.memory.constructor; |
+ } |
+ } |
+ if (typeof Geolocation == "undefined") { |
+ navigator.geolocation.constructor; |
+ } |
+ if (typeof Animation == "undefined") { |
+ let d = document.createElement('div'); |
+ if (typeof d.animate != "undefined") { |
+ window.Animation = d.animate(d).constructor; |
+ } |
+ } |
+ if (typeof SourceBufferList == "undefined") { |
+ window.SourceBufferList = new MediaSource().sourceBuffers.constructor; |
+ } |
+ } |
+ return typeof window == "undefined" ? global : window; |
+ })(); |
dart.JsSymbol = Symbol; |
dart._mixins = Symbol("mixins"); |
dart.implements = Symbol("implements"); |