1

如果 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);
});

这个问题有什么解决方法吗?

4

0 回答 0