1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-26 12:29:06 +01:00

Remove bind calls from console errors

This commit is contained in:
Dan Finlay 2016-08-29 16:49:58 -07:00
parent fb6476224f
commit 6838027c65

View File

@ -43,20 +43,20 @@ function setupStreams(){
name: 'contentscript', name: 'contentscript',
target: 'inpage', target: 'inpage',
}) })
pageStream.on('error', console.error.bind(console)) pageStream.on('error', console.error)
var pluginPort = extension.runtime.connect({name: 'contentscript'}) var pluginPort = extension.runtime.connect({name: 'contentscript'})
var pluginStream = new PortStream(pluginPort) var pluginStream = new PortStream(pluginPort)
pluginStream.on('error', console.error.bind(console)) pluginStream.on('error', console.error)
// forward communication plugin->inpage // forward communication plugin->inpage
pageStream.pipe(pluginStream).pipe(pageStream) pageStream.pipe(pluginStream).pipe(pageStream)
// connect contentscript->inpage reload stream // connect contentscript->inpage reload stream
var mx = ObjectMultiplex() var mx = ObjectMultiplex()
mx.on('error', console.error.bind(console)) mx.on('error', console.error)
mx.pipe(pageStream) mx.pipe(pageStream)
var reloadStream = mx.createStream('reload') var reloadStream = mx.createStream('reload')
reloadStream.on('error', console.error.bind(console)) reloadStream.on('error', console.error)
// if we lose connection with the plugin, trigger tab refresh // if we lose connection with the plugin, trigger tab refresh
pluginStream.on('close', function () { pluginStream.on('close', function () {