Created
February 16, 2011 23:05
-
-
Save jxa/830488 to your computer and use it in GitHub Desktop.
can't assign to an existing context property in REPL?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ node ./test.js | |
> setContext('sup', 'yo') | |
> sup | |
'yo' | |
> setContext('sup', 'what?') | |
> sup | |
'yo' | |
> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var repl = require('repl'), | |
session = repl.start(), | |
context = session.context; | |
context.setContext = function(key, val){ | |
context[key] = val; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment