def m
`#{"return"}`
end
@iliabylich now this multiline patch breaks for example:
def self.find(selector)
`$(#{selector})`
end
from opal-query, which is now considered a multiline, so no return is added, leading to:
return Opal.defs(self, '$find', TMP_find_1 = function $$find(selector) {
var self = this;
$(selector)
}, TMP_find_1.$$arity = 1)
multiline = strs.any? { |str| str.end_with?("\n") }
does seem to do the right thing
js #{ ruby } more js
:str
`$(#{selector})`
:str
s
:str
but multiple :str, was, now with above fix, to look in the :str
for a \n
mulitline js is detected.Promise
implementation in favor of an API closer to what newer browsers offer natively, which is kinda scary.
$$.setTimeout(method(:tick).to_proc, 2000)
http://opalrb.com/try/?code:def%20tick%0A%20%20puts%20%22yo%22%0Aend%0A%0A%24%24.setTimeout(method(%3Atick).to_proc%2C%20500)