From 7acc4c5d13b02fad0e8d7e5599ab82f87ecb382e Mon Sep 17 00:00:00 2001 From: serapath Date: Tue, 5 Sep 2017 18:11:00 +0200 Subject: [PATCH] restrict available terminal commands for scripts --- src/app/panels/terminal.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/app/panels/terminal.js b/src/app/panels/terminal.js index ad6fdffdd0..952dbac108 100644 --- a/src/app/panels/terminal.js +++ b/src/app/panels/terminal.js @@ -579,14 +579,14 @@ class Terminal { } function domTerminalFeatures (self, scopedCommands) { - var ctx = scopedCommands - ctx.web3 = executionContext.getProvider() !== 'vm' ? new Web3(executionContext.web3().currentProvider) : null, - ctx.console = console = { - log: function () { scopedCommands.log.apply(scopedCommands, arguments) }, - info: function () { scopedCommands.info.apply(scopedCommands, arguments) }, - error: function () { scopedCommands.error.apply(scopedCommands, arguments) } + return { + web3: executionContext.getProvider() !== 'vm' ? new Web3(executionContext.web3().currentProvider) : null, + console: { + log: function () { scopedCommands.log.apply(scopedCommands, arguments) }, + info: function () { scopedCommands.info.apply(scopedCommands, arguments) }, + error: function () { scopedCommands.error.apply(scopedCommands, arguments) } + } } - return context } function findDeep (object, fn, found = { break: false, value: undefined }) {