6 Commits

Author SHA1 Message Date
Ruben Bridgewater
e885726a7f
Fix linting errors 2018-09-19 10:22:48 +02:00
Renée Kooi
0fdd418274
Change process.stdout switcharoo to a full net.Socket instance
No matter how you write to stdout, this should catch it!
The `defineProperty` call uses the same options as the default `process.stdout`.
2018-08-24 13:25:11 +02:00
Renée Kooi
fb59f94773
Throw error if a cluster subprocess is forked
0x doesn't support it.

I used the 'fork' event because it's easier than intercepting `require`
and this way it allows requiring but not using `cluster`.
If the subprocess does `try { cluster.fork() }` this won't crash, but
that's probably fine? Same if the subprocess has an 'uncaughtException'
handler.

Ex:

```
➜  ./cmd.js cluster.js
🔥  Profiling/home/goto-bus-stop/Code/nearform/0x/lib/preload/no-cluster.js:4
  throw new Error('0x does not support clustering.')
  ^
Error: 0x does not support clustering.
    at EventEmitter.cluster.on (/home/goto-bus-stop/Code/nearform/0x/lib/preload/no-cluster.js:4:9)
    at EventEmitter.emit (events.js:182:13)
    at emitForkNT (internal/cluster/master.js:226:11)
    at process._tickCallback (internal/process/next_tick.js:63:19)
    at Function.Module.runMain (internal/modules/cjs/loader.js:745:11)
    at startup (internal/bootstrap/node.js:266:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:596:3)
🚫  Target subprocess error, code: 1
```
2018-08-24 11:32:10 +02:00
Mathias Buus
afd1466a78 fix signalling on windows 2018-07-24 21:58:16 +02:00
davidmarkclements
c32c7a91dc improve inlinable capturing, now allows for other v8 to stdout, e.g. --trace-opt etc 2018-03-24 14:45:44 +01:00
davidmarkclements
d21aae0211 preload dir 2018-03-20 17:16:04 +01:00