-
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathnode-ipc+9.1.1.patch
59 lines (52 loc) · 1.97 KB
/
node-ipc+9.1.1.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
diff --git a/node_modules/node-ipc/dao/client.js b/node_modules/node-ipc/dao/client.js
index 41ce504..c28f5a8 100644
--- a/node_modules/node-ipc/dao/client.js
+++ b/node_modules/node-ipc/dao/client.js
@@ -7,15 +7,13 @@ const net = require('net'),
fs = require('fs'),
Queue = require('js-queue');
-let Events = require('event-pubsub/es5');
-if(process.version[1]>4){
- Events = require('event-pubsub');
-}
+const Events = require('event-pubsub/es6');
-let eventParser = new EventParser();
+let eventParser;
class Client extends Events{
constructor(config,log){
+ if (!eventParser) eventParser = new EventParser();
super();
Object.assign(
this,
diff --git a/node_modules/node-ipc/dao/socketServer.js b/node_modules/node-ipc/dao/socketServer.js
index 4fd99be..f56c072 100644
--- a/node_modules/node-ipc/dao/socketServer.js
+++ b/node_modules/node-ipc/dao/socketServer.js
@@ -7,15 +7,13 @@ const net = require('net'),
EventParser = require('../entities/EventParser.js'),
Message = require('js-message');
-let Events = require('event-pubsub/es5');
-if(process.version[1]>4){
- Events = require('event-pubsub');
-}
+const Events = require('event-pubsub/es6');
-let eventParser = new EventParser();
+let eventParser;
class Server extends Events{
constructor(path,config,log,port){
+ if (!eventParser) eventParser = new EventParser();
super();
Object.assign(
this,
diff --git a/node_modules/node-ipc/node-ipc.js b/node_modules/node-ipc/node-ipc.js
index 1c63360..bf84820 100644
--- a/node_modules/node-ipc/node-ipc.js
+++ b/node_modules/node-ipc/node-ipc.js
@@ -18,4 +18,7 @@ class IPCModule extends IPC{
}
}
-module.exports=new IPCModule;
+// This returns the IPCModule class instead of the IPCModule instance, so that
+// this can be snapshotted. In unsnapshottable.js, this module gets
+// monkey-patched to return an IPCModule instance instead of the class.
+module.exports=IPCModule;