Skip to content

Commit 755c90e

Browse files
committed
preflight + ES5Class 2.x
1 parent dd12c9f commit 755c90e

File tree

4 files changed

+7
-9
lines changed

4 files changed

+7
-9
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Firing up an efficient JSON-RPC server becomes extremely simple:
2424
var rpc = require('json-rpc2');
2525

2626
var server = rpc.Server.create({
27-
'websocket': true // is true by default
27+
'websocket': true, // is true by default
2828
'headers': { // allow custom headers is empty by default
2929
'Access-Control-Allow-Origin': '*'
3030
}
@@ -122,8 +122,8 @@ Don't forget, when you are overloading an existing function, you can call the or
122122
var rpc = require('json-rpc2');
123123

124124
rpc.Endpoint.implement({
125-
'trace': function(direction, message){
126-
this.$super(' (' + direction + ')', message); //call the last defined function
125+
'trace': function($super, direction, message){
126+
$super(' (' + direction + ')', message); //call the last defined function
127127
}
128128
});
129129
```

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "json-rpc2",
3-
"version": "0.6.0",
3+
"version": "0.7.0",
44
"description": "JSON-RPC 2.0 server and client library, with HTTP, TCP and Websocket endpoints",
55
"main": "./src/jsonrpc.js",
66
"keywords": [

src/connection.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ module.exports = function (classes){
66
EventEmitter = classes.EventEmitter,
77
Connection = EventEmitter.$define('Connection', {
88
construct: function ($super, ep){
9-
console.log('connection super', $super);
10-
119
$super();
1210

1311
this.endpoint = ep;
@@ -64,7 +62,9 @@ module.exports = function (classes){
6462
*/
6563
stream: function (onend){
6664
if (_.isFunction(onend)) {
67-
this.on('end', onend);
65+
this.on('end', function(){
66+
onend();
67+
});
6868
}
6969
},
7070

src/socket-connection.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ module.exports = function (classes){
1414
construct: function ($super, endpoint, conn){
1515
var self = this;
1616

17-
console.log('socket connection super', $super);
18-
1917
$super(endpoint);
2018

2119
self.conn = conn;

0 commit comments

Comments
 (0)