stackoverflow using CmdPair with long lists #1288

fmpwizard opened this Issue Jul 2, 2012 · 0 comments

3 participants

Lift Web Framework member

As described on this thread

I was doing some work using comet and I run into some stackoverflow
errors. I was able to narrow it down to this short example: that runs
on the repl

val l= JsRaw("alert('0')").cmd
val r= JsRaw("alert('0')").cmd
val c= CmdPair(l,r)
val z = 1 to 11110 map { x => JsRaw("""alert('""" + x + """') """).cmd}
val result= z.foldLeft(c)((a, b) => CmdPair(a, b))
result.left.toJsCmd  //if I comment this line out, no stackoverflow occurs, but if I leave the line there, I get:

java.lang.StackOverflowError: null
    at net.liftweb.http.js.JsCmds$CmdPair.append(JsCommands.scala:800)
    at net.liftweb.http.js.JsCmds$CmdPair.append(JsCommands.scala:801)
@dpp dpp was assigned Jul 2, 2012
@bearfeeder bearfeeder closed this in 3036ba2 Jul 2, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment