Update compiler.js

This commit is contained in:
VoR0220 2015-10-27 11:54:43 -05:00 committed by Iuri Matias
parent f864bb6098
commit 078e3240db

View File

@ -34,7 +34,6 @@ Compiler.prototype.compile_solidity = function(contractFiles) {
compiled_object[className].info = {}; compiled_object[className].info = {};
compiled_object[className].info.abiDefinition = JSON.parse(contract.interface); compiled_object[className].info.abiDefinition = JSON.parse(contract.interface);
} }
//console.log(compiled_object);
return compiled_object; return compiled_object;
}; };
@ -82,7 +81,6 @@ Compiler.prototype.compile_serpent = function(contractFile) {
Compiler.prototype.compile = function(contractFiles) { Compiler.prototype.compile = function(contractFiles) {
var solidity = [], serpent = []; var solidity = [], serpent = [];
for (var i = 0; i < contractFiles.length; i++) { for (var i = 0; i < contractFiles.length; i++) {
var extension = contractFiles[i].split('.')[1]; var extension = contractFiles[i].split('.')[1];
if (extension === 'sol') { if (extension === 'sol') {
@ -95,7 +93,7 @@ Compiler.prototype.compile = function(contractFiles) {
throw new Error("extension not known, got " + extension); throw new Error("extension not known, got " + extension);
} }
} }
//TODO: Get these compiling and returning together...problem might come with the JSON objects
if (solidity.length > 0) return this.compile_solidity(solidity); if (solidity.length > 0) return this.compile_solidity(solidity);
if (serpent.length > 0) return this.compile_serpent(serpent); if (serpent.length > 0) return this.compile_serpent(serpent);
}; };