lib/preact.rb in isomorfeus-preact-10.6.18 vs lib/preact.rb in isomorfeus-preact-10.6.19
- old
+ new
@@ -55,11 +55,12 @@
self.prop_dictionary[snake_cased_word] = res;
return res;
};
self.native_element_or_component_to_ruby = function (element) {
- if (typeof element.__ruby_instance !== 'undefined') { return element.__ruby_instance }
- if (element instanceof Element || element instanceof Node) { return #{Browser::Element.new(`element`)} }
+ if (element == null || typeof(element) === 'undefined' ) { return nil; }
+ if (typeof element.__ruby_instance !== 'undefined') { return element.__ruby_instance; }
+ if (element instanceof Element || element instanceof Node) { return #{Browser::Element.new(`element`)}; }
return element;
};
self.native_to_ruby_event = function(event) {
if ('target' in event) { return #{::Browser::Event.new(`event`)}; }