From 664cc77d4337da4fc6879f8daf4a1258737eebb3 Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Mon, 1 Sep 2014 11:10:28 +0200 Subject: [PATCH] Add caktux's JS console helpers. --- libqethereum/QEthereum.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libqethereum/QEthereum.h b/libqethereum/QEthereum.h index b145da59a..645c91740 100644 --- a/libqethereum/QEthereum.h +++ b/libqethereum/QEthereum.h @@ -225,6 +225,8 @@ private: frame->evaluateJavaScript("String.prototype.dec = function() { env.warn('THIS CALL IS DEPRECATED. USE eth.* INSTEAD.'); return eth.toDecimal(this) }"); \ frame->evaluateJavaScript("String.prototype.fix = function() { env.warn('THIS CALL IS DEPRECATED. USE eth.* INSTEAD.'); return eth.toFixed(this) }"); \ frame->evaluateJavaScript("String.prototype.sha3 = function() { env.warn('THIS CALL IS DEPRECATED. USE eth.* INSTEAD.'); return eth.sha3old(this) }"); \ + frame->evaluateJavaScript("console.log = env.note"); \ + frame->evaluateJavaScript("window.onerror = function (errorMsg, url, lineNumber, column, errorObj) { env.warn('Error: ' + errorMsg + ', Script: ' + url + ', Line: ' + lineNumber + ', Column: ' + column + ', StackTrace: ' + String(errorObj)) }"); \ } template inline boost::multiprecision::number> toInt(QString const& _s)