Handle reading multiple lines of input to spidermonkey