function | since v0.0-2496 | Edit |
(js-line-and-column stack-element)
(defn js-line-and-column [stack-element]
"Returns a 2-element vector containing the line and
column encoded at the end of a stack element string.
A line or column will be represented as NaN if not
parsesable."
(let [parts (.split stack-element ":")
cnt (count parts)]
(if (> cnt 1)
[(js/parseInt (nth parts (- cnt 2)) 10)
(js/parseInt (nth parts (dec cnt)) 10)]
[##NaN ##NaN])))