scala-js/scala-js-dom

PerformanceTiming claims to return Int but they overflow

behaghel opened this issue · 1 comments

I was trying to use it but I systematically get the following error when I access any of its values: XXXXX is not an instance of java.lang.Integer in the browser. Taking the js.Dynamic route works fine.

Fails:

    val window = dom.document.defaultView
    val perf = window.performance.timing
    PageLoad(perf.loadEventStart - perf.navigationStart)

Works:

    val window = DOMGlobalScope.window
    val perf = window.performance.timing
    PageLoad(perf.loadEventStart.asInstanceOf[Double] - perf.navigationStart.asInstanceOf[Double])
sjrd commented

I guess it should return Double ...
Thanks for the report.