lib/watir/frame.rb in watir-3.0.0.rc1 vs lib/watir/frame.rb in watir-3.0.0.rc2
- old
+ new
@@ -53,12 +53,10 @@
rescue WIN32OLERuntimeError, NoMethodError #if eval fails we need to use execScript(source.to_s) which does not return a value, hence the workaround
escaped_src = source.to_s.gsub(/[\r\n']/) {|m| "\\#{m}"}
wrapper = "_watir_helper_div_#{Time.now.to_i}"
cmd = "var e = document.createElement('DIV'); e.style.display = 'none'; e.id='#{wrapper}'; e.innerHTML = eval('#{escaped_src}'); document.body.appendChild(e);"
document.parentWindow.execScript(cmd)
- wrapper_obj = document.getElementById(wrapper)
- result_value = wrapper_obj.innerHTML
- result_value
+ document.getElementById(wrapper).wrapper_obj.innerHTML
end
end
end