lib/preact.rb in isomorfeus-preact-10.6.6 vs lib/preact.rb in isomorfeus-preact-10.6.7

- old
+ new

@@ -61,11 +61,11 @@ if (element instanceof Element || element instanceof Node) { return #{Browser::Element.new(`element`)} } return element; }; self.native_to_ruby_event = function(event) { - if (event.hasOwnProperty('target')) { return #{::Browser::Event.new(`event`)}; } + if ('target' in event) { return #{::Browser::Event.new(`event`)}; } else if (Array.isArray(event)) { return event; } else { return Opal.Hash.$new(event); } }; self.internal_prepare_args_and_render = function(component, args, block) { @@ -217,10 +217,10 @@ self.deep_force_update = function(component) { if (component.forceUpdate) { component.forceUpdate(); } if (component.__c) { self.deep_force_update(component.__c); } else if (component.base) { self.update_components_from_dom(component.base); } }; - + self.update_components_from_dom = function(node, fn) { let children = node.childNodes; for (let i=children && children.length; i--;) { let child = children[i]; if (child.__c) { self.deep_force_update(child.__c); }