Index: pkg/browser/lib/interop.js |
diff --git a/pkg/browser/lib/interop.js b/pkg/browser/lib/interop.js |
index 40e1700ad76d53fe7d69ec4819c10387678d1789..8577e4f28b8c30aa67270ff78727da5789d0bea0 100644 |
--- a/pkg/browser/lib/interop.js |
+++ b/pkg/browser/lib/interop.js |
@@ -224,7 +224,9 @@ function DartProxy(o) { |
(function() { |
// Proxy support for js.dart. |
- var globalContext = window; |
+ // We don't use 'window' because we might be in a web worker, but we don't |
+ // use 'self' because not all browsers support it |
+ var globalContext = function() { return this; }(); |
// Table for local objects and functions that are proxied. |
function ProxiedObjectTable() { |