Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(100)

Unified Diff: pkg/polymer/lib/src/instance.dart

Issue 326633006: polymer -- fix for ie10 (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: more commentary Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/pkg.status ('k') | pkg/polymer/lib/src/loader.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « pkg/pkg.status ('k') | pkg/polymer/lib/src/loader.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698