Skip to content

Commit

Permalink
Format using standard
Browse files Browse the repository at this point in the history
  • Loading branch information
axic committed Oct 25, 2016
1 parent 8914952 commit 2126391
Show file tree
Hide file tree
Showing 31 changed files with 1,508 additions and 1,501 deletions.
8 changes: 4 additions & 4 deletions background.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/* global chrome */
'use strict';
'use strict'

chrome.browserAction.onClicked.addListener(function (tab) {
chrome.storage.sync.set({ 'chrome-app-sync': true });
chrome.storage.sync.set({ 'chrome-app-sync': true })

chrome.tabs.create({ 'url': chrome.extension.getURL('index.html') }, function (tab) {
// tab opened
});
});
})
})
60 changes: 30 additions & 30 deletions ci/makeMockCompiler.js
Original file line number Diff line number Diff line change
@@ -1,56 +1,56 @@
var fs = require('fs');
var solc = require('solc/wrapper');
var soljson = require('../soljson');
var compiler = solc(soljson);
var inputs = require('../test-browser/mockcompiler/requests.js');
var compilationResult = gatherCompilationResults(inputs);
replaceSolCompiler(compilationResult);
var fs = require('fs')
var solc = require('solc/wrapper')
var soljson = require('../soljson')
var compiler = solc(soljson)
var inputs = require('../test-browser/mockcompiler/requests.js')
var compilationResult = gatherCompilationResults(inputs)
replaceSolCompiler(compilationResult)

function gatherCompilationResults (sol) {
var compilationResult = {};
var compilationResult = {}
for (var k in sol) {
var item = sol[k];
var result = compile(item, 1);
compilationResult[result.key] = result;
result = compile(item, 0);
compilationResult[result.key] = result;
var item = sol[k]
var result = compile(item, 1)
compilationResult[result.key] = result
result = compile(item, 0)
compilationResult[result.key] = result
}
return compilationResult;
return compilationResult
}

function compile (source, optimization) {
var missingInputs = [];
var missingInputs = []
var result = compiler.compile(source, optimization, function (path) {
missingInputs.push(path);
});
var key = optimization.toString();
missingInputs.push(path)
})
var key = optimization.toString()
for (var k in source.sources) {
key += k + source.sources[k];
key += k + source.sources[k]
}
key = key.replace(/(\t)|(\n)|( )/g, '');
key = key.replace(/(\t)|(\n)|( )/g, '')
return {
key: key,
source: source,
optimization: optimization,
missingInputs: missingInputs,
result: result
};
}
}

function replaceSolCompiler (results) {
fs.readFile('./test-browser/mockcompiler/compiler.js', 'utf8', function (error, data) {
if (error) {
console.log(error);
process.exit(1);
return;
console.log(error)
process.exit(1)
return
}
data = data + '\n\nvar mockData = ' + JSON.stringify(results) + ';\n';
data = data + '\n\nvar mockData = ' + JSON.stringify(results) + ';\n'
fs.writeFile('./soljson.js', data, 'utf8', function (error) {
if (error) {
console.log(error);
process.exit(1);
return;
console.log(error)
process.exit(1)
return
}
});
});
})
})
}
Loading

0 comments on commit 2126391

Please sign in to comment.