I'm trying to debug a script interactively by command line. If I paste a multiline command the interpreter seems unable to parse the line returns. E.g. trying to paste
page.onConsoleMessage = function(msg) {
console.log(msg);
};
Fails with:
phantomjs> page.onConsoleMessage = function(msg) {
Expected token '}'
phantomjs://repl-input:1 in global code
phantomjs> console.log(msg);
Can't find variable: msg
phantomjs://repl-input:1 in global code
phantomjs> };
Parser error
phantomjs://repl-input:1 in global code
Is there any way to make phantom recognise line returns or expect a multiline comment?