forked from ethereum/remix-ide
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
31 changed files
with
1,508 additions
and
1,501 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
}); | ||
}); | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} | ||
}); | ||
}); | ||
}) | ||
}) | ||
} |
Oops, something went wrong.