Skip to content

Commit b6c416b

Browse files
committed
Fix repl
1 parent 26ed92e commit b6c416b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/repl.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const evaluate = (cmd, context, filename, callback) => {
2323
try {
2424
const expression = parse(cmd, '');
2525
expression.evaluate(context).then(value => {
26-
context.scope._ = value;
26+
context.setVariable('_', value);
2727
callback(null, value.asNativeValue(context));
2828
}).catch(e => {
2929
e.context = undefined;
@@ -45,8 +45,8 @@ export const repl = context => {
4545
r.defineCommand('scope', {
4646
help: 'Dump scope',
4747
action(name) {
48-
Object.keys(this.context.scope).forEach(key => {
49-
const value = this.context.scope[key].asNativeValue(this.context);
48+
Object.keys(this.context.getScope()).forEach(key => {
49+
const value = this.context.getVariable(key).asNativeValue(this.context);
5050
console.log(`${key} = ${value}`);
5151
});
5252
this.displayPrompt();

0 commit comments

Comments
 (0)