Files
meteor/tools
Ben Newman 2443d83226 Reenable tab-completion of global variable names in meteor shell.
Summary:
Before this commit you could type `Meteor.is` in a `meteor shell` session
and then tab to see a list of possible completions (e.g.
`Meteor.isClient`, `Meteor.isServer`), but typing a prefix of a global
variable name like `Mete` followed by tab has been broken ever since we
stopped using the global object as the REPL context:
https://github.com/meteor/meteor/commit/7c7e52f2d2

The reason for that commit was to prevent the REPL from overwriting the
global `_` variable (which most Meteor developers expect to be bound to
`require("underscore")`): https://github.com/meteor/meteor/3227

This commit solves #3227 by making `repl.context._` a read-only property
that is permanently "bound" to underscore.  As a bonus, we now intercept
assignments to `_` and store those values as `repl.context.__`, so you
still have access to the last result in the shell via `__`.

Test Plan:
Run `meteor shell`, evaluate a few expressions, and see that (1) global
variables can be tab-completed, (2) `_` remains bound to underscore, and
(3) `__` gets bound to the result of the evaluated expressions.

Reviewers: avital, stubailo, glasser

Reviewed By: glasser

Differential Revision: https://phabricator.meteor.io/D12
2015-01-15 13:49:57 -05:00
..
2014-12-12 09:03:10 -05:00
2015-01-13 13:53:22 -08:00
2014-03-05 23:33:06 -08:00
2014-12-04 17:56:04 -08:00
2014-12-17 00:36:57 -08:00
2015-01-12 11:23:54 -08:00
2015-01-13 16:35:39 -08:00
2015-01-13 16:35:39 -08:00
2014-12-17 00:13:07 -08:00
2014-12-17 00:13:07 -08:00
2014-06-13 17:14:42 -07:00
2015-01-14 18:35:43 -08:00
2014-12-06 19:13:51 -08:00
2014-12-04 17:56:04 -08:00
2014-11-25 09:06:25 -08:00
2015-01-13 16:05:18 -08:00
2014-12-22 12:27:55 -08:00