如果spooky.then()中有任何非英文字符,SpookyJS会挂起

时间:2014-09-04 05:10:41

标签: node.js casperjs spookyjs

如果spooky.then函数中有任何国际字符,SpookyJS会挂起。

try {
    var Spooky = require('spooky');
} catch (e) {
    var Spooky = require('../lib/spooky');
}

var spooky = new Spooky({
    child: {
        transport: 'http'
    },
    casper: {
        logLevel: 'debug',
        verbose: true
    }
}, function (err) {
    if (err) {
        e = new Error('Failed to initialize SpookyJS');
        e.details = err;
        throw e;
    }

    spooky.start('http://en.wikipedia.org/wiki/Spooky_the_Tuff_Little_Ghost');
    spooky.then(function () {
        // 안녕
        this.emit('hello', 'Hello World');
    });
    spooky.run();
});

spooky.on('hello', function (greeting) {
    console.log(greeting);
});

spooky.on('console', function (line) {
    console.log(line);
});

此问题是否有解决方法?

0 个答案:

没有答案