restrict available terminal commands for scripts

pull/1/head
serapath 8 years ago
parent d5d15f7f9a
commit 7acc4c5d13
  1. 8
      src/app/panels/terminal.js

@ -579,14 +579,14 @@ class Terminal {
} }
function domTerminalFeatures (self, scopedCommands) { function domTerminalFeatures (self, scopedCommands) {
var ctx = scopedCommands return {
ctx.web3 = executionContext.getProvider() !== 'vm' ? new Web3(executionContext.web3().currentProvider) : null, web3: executionContext.getProvider() !== 'vm' ? new Web3(executionContext.web3().currentProvider) : null,
ctx.console = console = { console: {
log: function () { scopedCommands.log.apply(scopedCommands, arguments) }, log: function () { scopedCommands.log.apply(scopedCommands, arguments) },
info: function () { scopedCommands.info.apply(scopedCommands, arguments) }, info: function () { scopedCommands.info.apply(scopedCommands, arguments) },
error: function () { scopedCommands.error.apply(scopedCommands, arguments) } error: function () { scopedCommands.error.apply(scopedCommands, arguments) }
} }
return context }
} }
function findDeep (object, fn, found = { break: false, value: undefined }) { function findDeep (object, fn, found = { break: false, value: undefined }) {

Loading…
Cancel
Save