repl: properly handle `repl.repl`
The repl property is set so that it's possible to inspect the
instances own properties during runtime. This was never tested and
it was also only exported in case the instance was started with
.start()
instead of using the constructor directly. In case that
more than a single instance was created, all instances got access
to the first instance.
From now on the repl property is only exported in case the repl is starte as standalone program.
Refs: https://github.com/nodejs/node/pull/30928#issuecomment-565821714
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes -
tests and/or benchmarks are included -
documentation is changed or added -
commit message follows commit guidelines