2013-10-07 13 views
11

Ich versuche, YUI-Kompressor für socket.io-basierte .js-Datei zu verwenden (ja, ich weiß, es ist Server-Skript und erfordert keine minfication, aber es ist Voraussetzung, damit ich weniger habe Steuerung). Mein Code ist wie folgt:Fehlender Name nach. Operator YUI Compressor für socket.io js files

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

Wenn ich ausführen YUI Kompressor ich Fehler @ dieser Zeile:

socket.volatile.emit('notification', json); 

[ERROR] 36:22:missing name after . operator 

Ich nehme an, es Fehler wirft becase flüchtig ist Schlüsselwort richtig? Kann mir jemand helfen, diesen Fehler loszuwerden?

+4

Buchse in Anführungszeichen [ 'volatile']. Emittieren() – user32225

+0

@ user32225 wow !! das ist großartig. Wenn du es als Antwort postest, kann ich es aufheben und akzeptieren :) –

+0

Thaks für den Tipp, werde ich machen. – user32225

Antwort

18

kein Kompressor Chaos mit reservierten Worten, wenn

socket['volatile'].emit() 
+0

funktioniert gut, löste mein ähnliches Problem mit einer '.super' Eigenschaft – MightyPork