fixed #28 and other small node.js issues

This commit is contained in:
Marek Kotewicz
2015-01-16 15:49:36 +01:00
parent 2c36d5ff45
commit 0172939490
10 changed files with 39 additions and 60 deletions

View File

@ -23,10 +23,10 @@
// TODO: is these line is supposed to be here?
if (process.env.NODE_ENV !== 'build') {
var web3 = require('./web3'); // jshint ignore:line
var BigNumber = require('bignumber.js'); // jshint ignore:line
}
var BigNumber = require('bignumber.js');
var web3 = require('./web3'); // jshint ignore:line
// TODO: make these be actually accurate instead of falling back onto JS's doubles.
var hexToDec = function (hex) {

View File

@ -20,11 +20,7 @@
* @date 2014
*/
// TODO: is these line is supposed to be here?
if (process.env.NODE_ENV !== 'build') {
var web3 = require('./web3'); // jshint ignore:line
}
var web3 = require('./web3'); // jshint ignore:line
var abi = require('./abi');
/// method signature length in bytes

View File

@ -23,10 +23,7 @@
* @date 2014
*/
// TODO: is these line is supposed to be here?
if (process.env.NODE_ENV !== 'build') {
var web3 = require('./web3'); // jshint ignore:line
}
var web3 = require('./web3'); // jshint ignore:line
/// should be used when we want to watch something
/// it's using inner polling mechanism and is notified about changes

View File

@ -24,9 +24,7 @@
*/
// TODO: is these line is supposed to be here?
if (process.env.NODE_ENV !== 'build') {
var web3 = require('./web3'); // jshint ignore:line
}
var web3 = require('./web3'); // jshint ignore:line
/**
* Provider manager object prototype

View File

@ -23,9 +23,6 @@
* @date 2014
*/
var Filter = require('./filter');
var ProviderManager = require('./providermanager');
/// Recursively resolves all promises in given object and replaces the resolved values with promises
/// @param any object/array/promise/anything else..
/// @returns (resolves) object with replaced promises with their result
@ -319,7 +316,7 @@ var web3 = {
/// eth object prototype
eth: {
watch: function (params) {
return new Filter(params, ethWatch);
return new web3.filter(params, ethWatch);
}
},
@ -329,7 +326,7 @@ var web3 = {
/// shh object prototype
shh: {
watch: function (params) {
return new Filter(params, shhWatch);
return new web3.filter(params, shhWatch);
}
},
@ -387,8 +384,6 @@ var shhWatch = {
setupMethods(shhWatch, shhWatchMethods());
web3.provider = new ProviderManager();
web3.setProvider = function(provider) {
provider.onmessage = messageHandler;
web3.provider.set(provider);
@ -411,5 +406,5 @@ function messageHandler(data) {
}
}
if (typeof(module) !== "undefined")
module.exports = web3;
module.exports = web3;