changed extend to _extend

This commit is contained in:
Fabian Vogelsteller 2015-06-08 14:46:19 +02:00
parent d14c706901
commit 7518ed47f8
8 changed files with 31 additions and 31 deletions

10
dist/web3-light.js vendored
View File

@ -1505,7 +1505,7 @@ Object.defineProperty(web3.eth, 'defaultAccount', {
// EXTEND
web3.extend = function(extension){
web3._extend = function(extension){
/*jshint maxcomplexity: 6 */
if(extension.property && !web3[extension.property])
@ -1514,10 +1514,10 @@ web3.extend = function(extension){
setupMethods(web3[extension.property] || web3, extension.methods || []);
setupProperties(web3[extension.property] || web3, extension.properties || []);
};
web3.extend.formatters = formatters;
web3.extend.utils = utils;
web3.extend.Method = require('./web3/method');
web3.extend.Property = require('./web3/property');
web3._extend.formatters = formatters;
web3._extend.utils = utils;
web3._extend.Method = require('./web3/method');
web3._extend.Property = require('./web3/property');
/// setups all api methods

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

10
dist/web3.js vendored
View File

@ -1505,7 +1505,7 @@ Object.defineProperty(web3.eth, 'defaultAccount', {
// EXTEND
web3.extend = function(extension){
web3._extend = function(extension){
/*jshint maxcomplexity: 6 */
if(extension.property && !web3[extension.property])
@ -1514,10 +1514,10 @@ web3.extend = function(extension){
setupMethods(web3[extension.property] || web3, extension.methods || []);
setupProperties(web3[extension.property] || web3, extension.properties || []);
};
web3.extend.formatters = formatters;
web3.extend.utils = utils;
web3.extend.Method = require('./web3/method');
web3.extend.Property = require('./web3/property');
web3._extend.formatters = formatters;
web3._extend.utils = utils;
web3._extend.Method = require('./web3/method');
web3._extend.Property = require('./web3/property');
/// setups all api methods

2
dist/web3.js.map vendored

File diff suppressed because one or more lines are too long

2
dist/web3.min.js vendored

File diff suppressed because one or more lines are too long

View File

@ -151,7 +151,7 @@ Object.defineProperty(web3.eth, 'defaultAccount', {
// EXTEND
web3.extend = function(extension){
web3._extend = function(extension){
/*jshint maxcomplexity: 6 */
if(extension.property && !web3[extension.property])
@ -160,10 +160,10 @@ web3.extend = function(extension){
setupMethods(web3[extension.property] || web3, extension.methods || []);
setupProperties(web3[extension.property] || web3, extension.properties || []);
};
web3.extend.formatters = formatters;
web3.extend.utils = utils;
web3.extend.Method = require('./web3/method');
web3.extend.Property = require('./web3/property');
web3._extend.formatters = formatters;
web3._extend.utils = utils;
web3._extend.Method = require('./web3/method');
web3._extend.Property = require('./web3/property');
/// setups all api methods

View File

@ -5,40 +5,40 @@ var web3 = require('../lib/web3');
var tests = [{
properties: [new web3.extend.Property({
properties: [new web3._extend.Property({
name: 'gasPrice',
getter: 'eth_gasPrice',
outputFormatter: web3.extend.formatters.outputBigNumberFormatter
outputFormatter: web3._extend.formatters.outputBigNumberFormatter
})]
},{
methods: [new web3.extend.Method({
methods: [new web3._extend.Method({
name: 'getBalance',
call: 'eth_getBalance',
params: 2,
inputFormatter: [web3.extend.utils.toAddress, web3.extend.formatters.inputDefaultBlockNumberFormatter],
outputFormatter: web3.extend.formatters.outputBigNumberFormatter
inputFormatter: [web3._extend.utils.toAddress, web3._extend.formatters.inputDefaultBlockNumberFormatter],
outputFormatter: web3._extend.formatters.outputBigNumberFormatter
})]
},{
property: 'admin',
properties: [new web3.extend.Property({
properties: [new web3._extend.Property({
name: 'gasPrice',
getter: 'eth_gasPrice',
outputFormatter: web3.extend.formatters.outputBigNumberFormatter
outputFormatter: web3._extend.formatters.outputBigNumberFormatter
})],
methods: [new web3.extend.Method({
methods: [new web3._extend.Method({
name: 'getBalance',
call: 'eth_getBalance',
params: 2,
inputFormatter: [web3.extend.utils.toAddress, web3.extend.formatters.inputDefaultBlockNumberFormatter],
outputFormatter: web3.extend.formatters.outputBigNumberFormatter
inputFormatter: [web3._extend.utils.toAddress, web3._extend.formatters.inputDefaultBlockNumberFormatter],
outputFormatter: web3._extend.formatters.outputBigNumberFormatter
})]
}];
describe('web3', function () {
describe('extend', function () {
describe('_extend', function () {
tests.forEach(function (test, index) {
it('test no: ' + index, function () {
web3.extend(test);
web3._extend(test);
if(test.properties)