将多行链接粘贴到phantomjs交互式会话中

时间:2017-07-07 08:35:55

标签: phantomjs

我试图通过命令行以交互方式调试脚本。如果我粘贴多行命令,解释器似乎无法解析行返回。例如。试图粘贴

page.onConsoleMessage = function(msg) {
  console.log(msg);
};

失败:

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

有没有办法让幻像识别换行符或期望多行注释?

0 个答案:

没有答案