vendor/gems/gems/firewatir-1.2.1/firewatir.rb
# 5/16/08 Derek Berner
# Wrapper method to send JS commands concisely,
# and propagate errors

5/16/08 Derek Berner
Wrapper method to send JS commands concisely,
and propagate errors
5 / 16 / 08 Derek Berner Wrapper method to send JS commands concisely and propagate errors
def js_eval(str)
    	    $jssh_socket.send("#{str};\n",0)
	        value = read_socket()
	        if md=/^(\w+)Error:(.*)$/.match(value) 
	            eval "class JS#{md[1]}Error\nend"
	            raise (eval "JS#{md[1]}Error"), md[2]
	        end
	        value
	    end
def js_eval ( str ) $jssh_socket . send ( "#{str};\n" , 0 ) value = read_socket ( ) if md = / ^( \w +)Error:(.*)$ / . match ( value ) eval "class JS#{md[1]}Error\nend" raise ( eval "JS#{md[1]}Error" ) , md [ 2 ] end value end
5/16/08 Derek Berner
Wrapper method to send JS commands concisely,
and propagate errors
5 / 16 / 08 Derek Berner Wrapper method to send JS commands concisely and propagate errors
#puts "JS Eval: #{str}"
 #puts "Value: #{value}"

str
<not_specific>