Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Don't use a separate context for the repl. #1904

Closed
wants to merge 1 commit into from

Conversation

isaacs
Copy link

@isaacs isaacs commented Oct 18, 2011

Fix #1484
Fix #1834
Fix #1482
Fix #771

It's been a while now, and we've seen how this separate context thing
works. It constantly confuses people, and no one actually uses '.clear'
anyway, so the benefit of that feature does not justify the constant
WTFery.

This makes repl.context actually be a getter that returns the global
object, and prints a deprecation warning. The '.clear' command is gone,
and will report that it's an invalid repl keyword. Tests updated to
allow the require, module, and exports globals, which are still
available in the repl just like they were before, by making them global.

Fix nodejs#1484
Fix nodejs#1834
Fix nodejs#1482
Fix nodejs#771

It's been a while now, and we've seen how this separate context thing
works.  It constantly confuses people, and no one actually uses '.clear'
anyway, so the benefit of that feature does not justify the constant
WTFery.

This makes repl.context actually be a getter that returns the global
object, and prints a deprecation warning.  The '.clear' command is gone,
and will report that it's an invalid repl keyword.  Tests updated to
allow the require, module, and exports globals, which are still
available in the repl just like they were before, by making them global.
@bnoordhuis
Copy link
Member

LGTM, works as advertised.

@isaacs
Copy link
Author

isaacs commented Oct 18, 2011

@ry Can you comment? It wouldn't be hard to keep this around as an optional argument to the repl, or even as a default that's disabled in the repl setup in node.js. More discussion (mostly cheers and outrage) in the linked bugs.

@ry
Copy link

ry commented Oct 18, 2011

LGTM.

@isaacs
Copy link
Author

isaacs commented Oct 19, 2011

Landed on b70fed4

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants