This fixes a kind of bug: the actual comparison was never used in the
if statement but only the result of `code | 0` since the equality
comparison was executed before the binary operator. Since the result
is fine by using only the binary operator, let's remove the equality
check.
So far the child process spawned to vizualize the data could be a
different one than the one used to run 0x. Now it's always the same
and there should be no mismatch left.
Fixes: #119
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
```
Reading v8 output from the stdout stream of a child process is sometimes
unreliable, chunks may be missing. The next `FUNCTION SOURCE` can be in
the middle of a previous `FUNCTION SOURCE`, cutting it off. The impact
can be alleviated slightly by accepting `FUNCTION SOURCE` identifiers
that occur in the middle of a line. It's not 100% accurate, because the
missing chunks may contain other `FUNCTION SOURCE` blocks, so we can
still be missing out on stuff. But, at least we don't dump function
source code to the shell anymore.
When this happens, the previous FUNCTION SOURCE block will not have been
closed by an END line, but END lines only set
`stdoutIsPrintOptSourceOutput` to false, and FUNCTION SOURCE lines set
it to true, so we don't have to do anything there.
Related to but does not quite fix#122