по следам дискуссий
А интересно, как в русском дискурсе тележный мастер любит поучать конструкторов реактивных лайнеров.
def jsGetTable(selector: String) = s"try { return extractTable(${selector.js}) } catch (err) { return [err.toString()] }"
jsGetTable
takes a CSS selector (it's a string); then a .js
method (that's "pimp my library" pattern) replaces all apostrophes with quote chars and wraps the result in apostrophes; this value replaces the ${...}
chunks, via Scala 2.10 String Interpolation.