Index: dart/sdk/lib/js/dart2js/js_dart2js.dart |
=================================================================== |
--- dart/sdk/lib/js/dart2js/js_dart2js.dart (revision 31466) |
+++ dart/sdk/lib/js/dart2js/js_dart2js.dart (working copy) |
@@ -544,7 +544,14 @@ |
Object _getDartProxy(o, String propertyName, createProxy(o)) { |
var dartProxy = JS('', '#[#]', o, propertyName); |
- if (dartProxy == null) { |
+ // Temporary fix for dartbug.com/15193 |
+ // In some cases it's possible to see a JavaScript object that |
+ // came from a different context and was previously proxied to |
+ // Dart in that context. The JS object will have a cached proxy |
+ // but it won't be a valid Dart object in this context. |
+ // For now we throw away the cached proxy, but we should be able |
+ // to cache proxies from multiple JS contexts and Dart isolates. |
+ if (dartProxy == null || !_isLocalObject(o)) { |
dartProxy = createProxy(o); |
_defineProperty(o, propertyName, dartProxy); |
} |