Closed zoechi closed 7 years ago
Same exception in Firefox 41.0.2
Ah so this is really a dart2js bug, you can fix it by wrapping the return value of modelForElement
in a js object (with new JsObject.fromBrowserObject(...)
)
Basically if a js object has HTMLElement
anywhere on its prototype chain then dart2js thinks its an html element instead of just a normal js object. The models for the template instances have Polymer.Base
on their prototype chain, and the prototype of that is HTMLElement
, so dart2js thinks these model objects are html elements, when they are not.
This is also arguably a polymer js bug, since none of the methods from HTMLElement.prototype are going to be valid for the model object ;)
cc @jacob314 @sigmundch
Thanks a lot for that workaround (works now) and your super-fast response :+1:
When I load
web/index.html
in Chrome I get the exception when I select a demo from the left drawer:https://github.com/bwu-dart/polymer_elements_demos/blob/master/web/all_demos.dart#L260
Works fine in Dartium bleeding edge.