socket.io ベースの .js ファイルに YUI コンプレッサーを使用しようとしています (はい、サーバー側のスクリプトであり、縮小化を必要としないことはわかっていますが、要件であるため、制御が少なくなります)。私のコードは次のようなものです:
fs.readFile('../examples/example.xml', function(err, data) {
if (err) throw err;
// parsing the new xml data and converting them into json file
var json = parser.toJson(data);
// adding the time of the last update
json.time = new Date();
// send the new data to the client
socket.volatile.emit('notification', json);
});
YUI コンプレッサーを実行すると、次の行でエラーが発生します。
socket.volatile.emit('notification', json);
[ERROR] 36:22:missing name after . operator
volatile がキーワードなので、エラーがスローされていると思いますか? 誰でもこのエラーを取り除く方法を教えてもらえますか?