Closed boehm-s closed 5 years ago
Thank you for your PR!
I think it is better to introduce nodejs-repl-use-global
custom variable so that .clear
command clears the current context. The current implementation sets useGlobal
to true as node CLI REPL does.
cf. https://nodejs.org/api/repl.html#repl_repl_start_options
What do you think?
% node -e "require('repl').start({ replMode: 'magic', useGlobal: true })"
> let foo = 1;
undefined
> .clear
> let foo = 2;
TypeError: Identifier 'foo' has already been declared
>
% node -e "require('repl').start({ replMode: 'magic', useGlobal: false })"
> let foo = 1;
undefined
> .clear
Clearing context...
> let foo = 2;
undefined
I haven't tought about that, it's way better, and cleaner for sure !
Do you think it's OK like that ?
I've published 0.2.1.
A while ago, I answered this question, and I think the command could be useful to other users.
I'm not experimented at all in elisp, so I'm open to all kind of suggestions,
Cheers