browser: fix error display.
This commit is contained in:
parent
94fd001e88
commit
761ae4a80c
7
.babelrc
7
.babelrc
@ -7,12 +7,5 @@
|
||||
"useBuiltins": "usage",
|
||||
"loose": true
|
||||
}]
|
||||
],
|
||||
"plugins": [
|
||||
["transform-runtime", {
|
||||
"helpers": true,
|
||||
"polyfill": true,
|
||||
"regenerator": true
|
||||
}]
|
||||
]
|
||||
}
|
||||
|
||||
@ -64,13 +64,16 @@ const node = new FullNode({
|
||||
workers: true,
|
||||
workerFile: '/worker.js',
|
||||
createSocket: (port, host) => {
|
||||
return ProxySocket.connect('ws://127.0.0.1:8080', port, host);
|
||||
const proto = global.location.protocol === 'https:' ? 'wss' : 'ws';
|
||||
const hostname = global.location.host;
|
||||
return ProxySocket.connect(`${proto}://${hostname}`, port, host);
|
||||
},
|
||||
logger: logger,
|
||||
plugins: [plugin]
|
||||
});
|
||||
|
||||
const {wdb} = node.require('walletdb');
|
||||
wdb.options.witness = true;
|
||||
|
||||
window.onunhandledrejection = function onunhandledrejection(event) {
|
||||
throw event.reason;
|
||||
@ -86,6 +89,11 @@ floating.onmouseup = function onmouseup(ev) {
|
||||
};
|
||||
|
||||
function show(obj) {
|
||||
if (obj instanceof Error) {
|
||||
floating.innerHTML = obj.stack;
|
||||
floating.style.display = 'block';
|
||||
return;
|
||||
}
|
||||
const json = obj && obj.toJSON ? obj.toJSON() : null;
|
||||
floating.innerHTML = escape(JSON.stringify(json, null, 2));
|
||||
floating.style.display = 'block';
|
||||
|
||||
@ -382,7 +382,7 @@ class Account {
|
||||
throw new Error(`Bad branch: ${branch}.`);
|
||||
}
|
||||
|
||||
this.save();
|
||||
this.save(b);
|
||||
|
||||
return key;
|
||||
}
|
||||
@ -961,8 +961,8 @@ Account.types = {
|
||||
*/
|
||||
|
||||
Account.typesByVal = [
|
||||
'pubkeyhash',
|
||||
'multisig'
|
||||
'PUBKEYHASH',
|
||||
'MULTISIG'
|
||||
];
|
||||
|
||||
/**
|
||||
|
||||
42
package.json
42
package.json
@ -23,27 +23,27 @@
|
||||
"node": ">=7.6.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"bclient": "^0.0.0",
|
||||
"bcfg": "^0.0.0",
|
||||
"bcrypto": "^0.0.0",
|
||||
"bdb": "^0.0.0",
|
||||
"bdns": "^0.0.0",
|
||||
"bevent": "^0.0.0",
|
||||
"bfile": "^0.0.0",
|
||||
"bfilter": "^0.0.0",
|
||||
"binet": "^0.0.0",
|
||||
"blgr": "^0.0.0",
|
||||
"bmutex": "^0.0.0",
|
||||
"bn.js": "^4.11.8",
|
||||
"bsock": "^0.0.0",
|
||||
"bsocks": "^0.0.0",
|
||||
"bstring": "^0.0.0",
|
||||
"btcp": "^0.0.0",
|
||||
"bufio": "^0.0.0",
|
||||
"bupnp": "^0.0.0",
|
||||
"bval": "^0.0.0",
|
||||
"bweb": "^0.0.0",
|
||||
"n64": "^0.0.18"
|
||||
"bcfg": "~0.0.0",
|
||||
"bclient": "~0.0.0",
|
||||
"bcrypto": "~0.0.0",
|
||||
"bdb": "~0.0.0",
|
||||
"bdns": "~0.0.0",
|
||||
"bevent": "~0.0.0",
|
||||
"bfile": "~0.0.0",
|
||||
"bfilter": "~0.0.0",
|
||||
"binet": "~0.0.0",
|
||||
"blgr": "~0.0.0",
|
||||
"bmutex": "~0.0.0",
|
||||
"bn.js": "~4.11.8",
|
||||
"bsock": "~0.0.0",
|
||||
"bsocks": "~0.0.0",
|
||||
"bstring": "~0.0.0",
|
||||
"btcp": "~0.0.0",
|
||||
"bufio": "~0.0.0",
|
||||
"bupnp": "~0.0.0",
|
||||
"bval": "~0.0.0",
|
||||
"bweb": "~0.0.0",
|
||||
"n64": "~0.1.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"babel-core": "^6.26.0",
|
||||
|
||||
Loading…
Reference in New Issue
Block a user