lib/glimmer/dsl/opal/custom_widget_expression.rb in glimmer-dsl-opal-0.12.0 vs lib/glimmer/dsl/opal/custom_widget_expression.rb in glimmer-dsl-opal-0.13.0
- old
+ new
@@ -85,11 +85,11 @@
# content.call(parent) if parent.is_a?(Glimmer::SWT::ShellProxy) || parent.is_a?(Glimmer::UI::CustomShell)
# end
def add_content(parent, keyword, *args, &block)
return unless parent.is_a?(Glimmer::UI::CustomWidget)
- # TODO consider avoiding source_location
- if block.source_location == parent.content&.__getobj__.source_location
+ # TODO consider avoiding source_location since it does not work in Opal
+ if block.source_location && (block.source_location == parent.content&.__getobj__&.source_location)
parent.content.call(parent) unless parent.content.called?
else
super
end
end