Commit 18f094d7 authored by Alex Beregszaszi's avatar Alex Beregszaszi

Standard: fix undefined/redefined variables

parent 66acb7a0
...@@ -15,7 +15,7 @@ module.exports = function (self) { ...@@ -15,7 +15,7 @@ module.exports = function (self) {
version = Module.cwrap("version", "string", []); version = Module.cwrap("version", "string", []);
if ('_compileJSONCallback' in Module) if ('_compileJSONCallback' in Module)
{ {
compileJSONInternal = Module.cwrap("compileJSONCallback", "string", ["string", "number", "number"]); var compileJSONInternal = Module.cwrap("compileJSONCallback", "string", ["string", "number", "number"]);
var missingInputCallback = Module.Runtime.addFunction(function(path) { var missingInputCallback = Module.Runtime.addFunction(function(path) {
missingInputs.push(Module.Pointer_stringify(path)); missingInputs.push(Module.Pointer_stringify(path));
}); });
......
...@@ -345,13 +345,14 @@ UniversalDApp.prototype.getCallButton = function (args) { ...@@ -345,13 +345,14 @@ UniversalDApp.prototype.getCallButton = function (args) {
var getGasUsedOutput = function (result, vmResult) { var getGasUsedOutput = function (result, vmResult) {
var $gasUsed = $('<div class="gasUsed">'); var $gasUsed = $('<div class="gasUsed">');
var caveat = lookupOnly ? '<em>(<span class="caveat" title="Cost only applies when called by a contract">caveat</span>)</em>' : ''; var caveat = lookupOnly ? '<em>(<span class="caveat" title="Cost only applies when called by a contract">caveat</span>)</em>' : '';
var gas;
if (result.gasUsed) { if (result.gasUsed) {
var gas = result.gasUsed.toString(10); gas = result.gasUsed.toString(10);
$gasUsed.html('<strong>Transaction cost:</strong> ' + gas + ' gas. ' + caveat); $gasUsed.html('<strong>Transaction cost:</strong> ' + gas + ' gas. ' + caveat);
} }
if (vmResult.gasUsed) { if (vmResult.gasUsed) {
var $callGasUsed = $('<div class="gasUsed">'); var $callGasUsed = $('<div class="gasUsed">');
var gas = vmResult.gasUsed.toString(10); gas = vmResult.gasUsed.toString(10);
$callGasUsed.append('<strong>Execution cost:</strong> ' + gas + ' gas.'); $callGasUsed.append('<strong>Execution cost:</strong> ' + gas + ' gas.');
$gasUsed.append($callGasUsed); $gasUsed.append($callGasUsed);
} }
...@@ -456,8 +457,10 @@ UniversalDApp.prototype.getCallButton = function (args) { ...@@ -456,8 +457,10 @@ UniversalDApp.prototype.getCallButton = function (args) {
// Only decode if there supposed to be fields // Only decode if there supposed to be fields
if (args.abi.outputs.length > 0) { if (args.abi.outputs.length > 0) {
try { try {
var i;
var outputTypes = []; var outputTypes = [];
for (var i = 0; i < args.abi.outputs.length; i++) { for (i = 0; i < args.abi.outputs.length; i++) {
outputTypes.push(args.abi.outputs[i].type); outputTypes.push(args.abi.outputs[i].type);
} }
...@@ -466,7 +469,7 @@ UniversalDApp.prototype.getCallButton = function (args) { ...@@ -466,7 +469,7 @@ UniversalDApp.prototype.getCallButton = function (args) {
// format decoded data // format decoded data
decodedObj = ethJSABI.stringify(outputTypes, decodedObj); decodedObj = ethJSABI.stringify(outputTypes, decodedObj);
for (var i = 0; i < outputTypes.length; i++) { for (i = 0; i < outputTypes.length; i++) {
var name = args.abi.outputs[i].name; var name = args.abi.outputs[i].name;
if (name.length > 0) { if (name.length > 0) {
decodedObj[i] = outputTypes[i] + ' ' + name + ': ' + decodedObj[i]; decodedObj[i] = outputTypes[i] + ' ' + name + ': ' + decodedObj[i];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment