Index: pkg/polymer/lib/src/instance.dart |
diff --git a/pkg/polymer/lib/src/instance.dart b/pkg/polymer/lib/src/instance.dart |
index 6ea826dfaceb8a07df34532876928e8f8c3b5b5d..ceb1119fbd623c0133bfe51e9dc2c24bfc213ad9 100644 |
--- a/pkg/polymer/lib/src/instance.dart |
+++ b/pkg/polymer/lib/src/instance.dart |
@@ -132,7 +132,15 @@ abstract class Polymer implements Element, Observable, NodeBindExtension { |
if (extendsTag != null) poly.attributes['extends'] = extendsTag; |
if (template != null) poly.append(template); |
- new JsObject.fromBrowserObject(poly).callMethod('init'); |
+ // TODO(jmesserly): conceptually this is just: |
+ // new JsObject.fromBrowserObject(poly).callMethod('init') |
+ // |
+ // However doing it that way hits an issue with JS-interop in IE10: we get a |
+ // JsObject that wraps something other than `poly`, due to improper caching. |
+ // By reusing _polymerElementProto that we used for 'register', we can |
+ // then call apply on it to invoke init() with the correct `this` pointer. |
+ JsFunction init = _polymerElementProto['init']; |
+ init.apply([], thisArg: poly); |
} |
// Note: these are from src/declaration/import.js |