From dd04d74769e1859d571de7c4f2e88cb85a227ab9 Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Mon, 28 Aug 2017 16:31:05 +0200 Subject: Examples: beautify JavaScript snippets Change-Id: I3499bfa49e79ed3664d020f7de0e691afeb15a86 Reviewed-by: Milian Wolff --- examples/webchannel/nodejs/chatclient.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'examples/webchannel/nodejs/chatclient.js') diff --git a/examples/webchannel/nodejs/chatclient.js b/examples/webchannel/nodejs/chatclient.js index 5e458f2..76b620c 100644 --- a/examples/webchannel/nodejs/chatclient.js +++ b/examples/webchannel/nodejs/chatclient.js @@ -91,7 +91,10 @@ var createWebChannel = function(transport, rlif) { console.log(' << ' + message); rlif.prompt(); // Go to end of existing input if any - rlif.write(null, {ctrl: true, name: 'e'}) + rlif.write(null, { + ctrl: true, + name: 'e' + }) }); rlif.on('line', function(line) { @@ -118,7 +121,9 @@ socket.on('open', function(event) { var transport = { // We cant't do 'send: socket.send' here // because 'send' wouldn't be bound to 'socket' - send: function(data) {socket.send(data)} + send: function(data) { + socket.send(data) + } }; createWebChannel(transport, createReadlineInterface()); @@ -131,12 +136,12 @@ socket.on('open', function(event) { }); }); -socket.on('error', function (error) { +socket.on('error', function(error) { console.log('Connection error: ' + error.message); process.exit(1); }); -socket.on('close', function () { +socket.on('close', function() { console.log('Connection closed.'); process.exit(1); }); -- cgit v1.2.1